GoogleMapsSDK:体系结构x86_64的未定义符号

我正在尝试安装Google maps SDK,并且在运行时遇到以下错误:

Undefined symbols for architecture x86_64: "_CBAdvertisementDataManufacturerDataKey", referenced from: -[GMSx_PEBeaconScanner centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in GoogleMaps(PEBeaconScanner.o) "_CBAdvertisementDataServiceDataKey", referenced from: -[GMSx_PEBeaconScanner centralManager:didDiscoverPeripheral:advertisementData:RSSI:] in GoogleMaps(PEBeaconScanner.o) "_CBCentralManagerScanOptionAllowDuplicatesKey", referenced from: -[GMSx_PEBeaconScanner scanIfAppropriate] in GoogleMaps(PEBeaconScanner.o) "_OBJC_CLASS_$_CBCentralManager", referenced from: objc-class-ref in GoogleMaps(PEBeaconScanner.o) "_OBJC_CLASS_$_CBUUID", referenced from: objc-class-ref in GoogleMaps(PEBeacon.o) objc-class-ref in GoogleMaps(PEBeaconScanner.o) "_vImageBoxConvolve_Planar8", referenced from: (anonymous namespace)::CreateBlurredImage(CGImage*, double, double) in GoogleMaps(GLWaterGroup.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) 

当我升级一个使用手动安装的旧版Google地图SDK的应用程序时,我发现了以下更改:

  • 需要链接到CoreBluetooth.frameworkAccelerate.framework在构build阶段 – >链接库与库。
  • “Other Linker Flags”下的-all_load标志将导致“重复符号”错误。 (改用-ObjC 。)

如果您使用CocoaPods安装方法(按照他们当前的说明),它应该采取所需的框架,但它仍然会被-all_load弄乱

确保以下内容

GoogleMaps SDK框架和捆绑

GoogleMaps(带有.framework扩展名)出现在你的根目录(你的.xcodeproj所在的目录)

GoogleMaps(带有.bundle扩展名)在您的xcode项目中被引用

以下框架

Accelerate.framework

AVFoundation.framework

CoreBluetooth.framework

CoreData.framework

CoreGraphics.framework

CoreLocation.framework

CoreText.framework

GLKit.framework

ImageIO.framework

的libc ++。dylib

libicucore.dylib

libz.dylib

OpenGLES.framework

QuartzCore.framework

Security.framework

SystemConfiguration.framework

构build设置

您的项目设置中的架构价值包括armv7。

其他链接器标志有-ObjC,如果不存在添加它

 **_vImageBoxConvolve_Planar8, referenced from: (anonymous namespace)::CreateBlurredImage(CGImage*, double, double) in GoogleMaps(GLWaterGroup.o)** This required "Accelerate.framework". So, please add it. Steps: 1)Build Phases -> Link Bundle with Libraries. 2)Click "+", 3)Select "Accelerate.framework". Finish. =================================== Others errors required "CoreBluetooth.framework. So, please add it also in similar way. 

看起来Google的API需要CoreBluetooth作为Beacon的位置。 在你的构build阶段链接到CoreBluetooth.framework ,一切都应该没问题。

在这里输入图像说明

编辑:确保通过这些说明安装GoogleMaps,以避免任何问题: https : //developers.google.com/maps/documentation/ios/start

我有同样的问题,在我的情况下,我有2 GoogleMap.framework的参考,我删除了旧的框架参考和问题得到解决:)

  • 点击项目
  • 构build阶段 – > 与库链接二进制文件 – >检查任何重复的参考目前为GoogleMaps.framework
  • 如果是,那么删除一个,你没有添加。
 **_vImageBoxConvolve_Planar8, referenced from: (anonymous namespace)::CreateBlurredImage(CGImage*, double, double) in GoogleMaps(GLWaterGroup.o)** This required "Accelerate.framework". So, please add it. Steps: 1)Build Phases -> Link Bundle with Libraries. 2)Click "+", 3)Select "Accelerate.framework". Finish. 

从(目标 – >生成设置 – >其他链接器标志)删除-all_load标志解决了我的问题,同时使用cocoa豆荚。