存档ReactNative获得了架构arm64的重复符号

时间:2017-09-24 16:31:22

标签: ios objective-c iphone react-native

我尝试使用ReactNative存档IOS项目。得到了这个错误:

duplicate symbol _OBJC_IVAR_$_RCTWebSocketModule._methodQueue in:
    /Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
    /Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
duplicate symbol _OBJC_IVAR_$_RCTWebSocketModule._sockets in:
    /Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
    /Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
duplicate symbol _OBJC_METACLASS_$_RCTWebSocketModule in:
    /Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libReact.a(RCTWebSocketModule.o)
    /Users/xuleyuan/Library/Developer/Xcode/DerivedData/SWCRN-ewdfdwvyvsgtsjbhztxszcugwdph/Build/Intermediates/ArchiveIntermediates/SWCRN/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a(RCTWebSocketModule.o)
ld: 441 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

但我可以正确使用模拟器运行它。我做了什么:

  1. 删除pod和主项目中的重复目标
  2. 搜索编译源但发现没有重复的内容
  3. 关闭所有目​​标的无共同阻挡
  4. 在project / Pods中,我找到了一个Headers文件夹,其中包含两个名为public和private的文件夹,其中包含重复文件。我应该删除其中一个文件夹吗?

1 个答案:

答案 0 :(得分:1)

最后。我解决了这个问题!

只需删除所有关于PodFile中的React(仅限React),一切都变得漂亮