iOS版高德地圖SDK將 AMapFoundationKit.framework 和 AMapLocationKit.framework放進項目中,編譯直接報錯:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
objc-class-ref in AMapFoundationKit(AMapFoundationKit-arm64-master.o)
"_OBJC_CLASS_$EAAccessoryManager", referenced from:
objc-class-ref in AMapLocationKit(AMapLocationKit-arm64-master.o)
d: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
解決方案:去TARGETS-Build Phases中的Link Binary With Libraries挤忙,點擊+重新引入一遍需要的系統(tǒng)庫CoreTelephony.framework淮椰,libc++.tbd管引,libz.tbd签餐,ExternalAccessory.framework 編譯通過.
當然我看到網(wǎng)絡上很多類似的,但是跟我情況又不是一樣的,比如下面的可以參考:
iOS 高德地圖定位sdk報錯Undefined symbols for architecture armv7: "OBJC_CLASS$_JSValue", referenced from: -->sw_gegewu
使用高德定位的SDK后集成編譯報錯--> shimeifang11
綜合自己情況和他人情況我得出:
1.下載高德地圖定位SDK的demo
2.參考自己項目中報錯 "OBJC_CLASS$XXXXX",去demo的 TARGETS-Build Phases中的Link Binary With Libraries 查看,XXXX和那個鏈接庫一致或類似,自己項目中引入.
3.或者直接將demo中的10個鏈接庫全部添加到自己項目中即可.
編譯通過.