Google 地图 iOS 与 CocoaPods 的集成问题

Google Maps iOS integration issue with CocoaPods

使用 Cocoapods 安装 Google 地图 API 后,我尝试显示以随机坐标为中心的示例地图。这对我来说很好。

在那之后,我尝试在地图上做一些更复杂的事情(添加标记、多段线...),我有一个 Undefined symbols for architecture armv7 错误,如下所述:

我验证了我是否没有导入某些库,但似乎我已经导入了所有需要的库。

我还验证了 "Other Linker Flag" 字段,以防万一缺少某些内容:

您是否知道该问题的解决方案或至少知道该问题的主要原因?

提前致谢

最后我找到了解决这个奇怪问题的奇怪方法。

开头,Podfile的内容:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'vanilla' do
    pod 'GoogleMaps'
end

target 'vanillaTests' do   
end

为了解决我的问题,我更改了 Podfile 的内容,如下所示:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'vanilla' do
    pod 'GoogleMaps'
end

target 'vanillaTests' do
    pod 'GoogleMaps'
end

我不知道为什么,但这解决了我的问题。请注意,我在测试中不使用 Google 地图。