链接器命令失败:架构arm64的重复符号

时间:2016-07-11 15:11:37

标签: ios xcode arm64

我在运行项目时遇到此错误。我提到了很多答案并做了同样的事情,但无法解决这个问题。

duplicate symbol _kReachabilityChangedNotification in:
/Users/admin/Downloads/workRepo/SafetraxApp/MAppIOS/build2/Safetrax/Build/Intermediates/Safetrax.build/Debug-iphoneos/Parent App.build/Objects-normal/arm64/Reachability.o
Pods/catapush-ios-sdk-pod/CatapushKit/libCatapushLib.a(CLIntReachability.o)
ld: 1 duplicate symbol for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1 个答案:

答案 0 :(得分:1)

I assume you are using the Reachability snippet from Apple. Unfortunately, that piece of code and the accompanying constants are being used in several Cocoapods. That's what causes this error. It basically means that the symbol/constant kReachabilityChangedNotification has been defined twice in your binary: once in your Application and once in the CatapushKit pod.

The easiest way to fix is: Rename the constant in your code. The other option would be to delete the Reachbility code from your app and use the CLIntReachability implementation from CatapushKit.