GoogleMapsSDK : Undefined symbols for architecture x86_64

ぃ、小莉子 提交于 2019-11-29 11:10:12

问题


I am trying to install the Google maps SDK and I am running through this error when running:

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)

回答1:


I noticed the following changes when I upgraded an app that was using the older Google maps SDK that had been installed manually:

  • Need to link to CoreBluetooth.framework and Accelerate.framework in Build Phases -> Link Bundle with Libraries.
  • The -all_load flag under "Other Linker Flags" will cause "duplicate symbol" errors. (Use -ObjC instead.)

If you use the CocoaPods method of installation (per their current instructions), it should take of the required frameworks but it'll still get messed up by -all_load.




回答2:


make sure following are included

GoogleMaps SDK framework and bundle

GoogleMaps (with .framework extension) is present at your root directory (where your .xcodeproj is)

GoogleMaps (with .bundle extension) is referenced in your xcode project

Following Frameworks

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 Settings

Architecture value in your project settings includes armv7.

Other Linker Flags has -ObjC , if not present add it




回答3:


**_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.



回答4:


It looks like Google's API needs CoreBluetooth for Beacon location. Link against CoreBluetooth.framework in your build phases and everything should be fine.

EDIT: Make sure to install GoogleMaps through those instructions to avoid any issue: https://developers.google.com/maps/documentation/ios/start




回答5:


I am having same problem, in my case I am having 2 reference of GoogleMap.framework, I deleted old framework reference and problem get solved :)

  • Click on project
  • In Build Phases -> Link Binary With Libraries -> Check any duplicate reference is present for GoogleMaps.framework
  • If yes then delete one, which you not added.



回答6:


**_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.



回答7:


Removing -all_load flag from (Targets->Build Settings->Other linker flag) resolved my issue while using cocoa pods.




回答8:


If anyone is experiencing this today, Linking CoreLocation.framework binary in Build Settings did the trick for me



来源:https://stackoverflow.com/questions/30712852/googlemapssdk-undefined-symbols-for-architecture-x86-64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!