使用xcode编译项目build失败(not allowed in a library)

最近使用Xcode编译项目总是失败,报如下错误:-ljcore-ios is not an object file (not allowed in a library)

原因:

经发现是jpush库和jcore库版本不匹配导致的,jpush-react-native使用版本1.7.1,jcore-react-native使用版本1.1.8,可jcore-react-native实际上使用的却是1.2.2

解决办法:
  1. 在xcode的libraries文件夹,将RCTJcoreModule.xcodeproj删掉;
  2. 使用命令npm i [email protected] --save重新安装jcore库;
  3. 使用命令react-native link jcore-react-native重新link;
  4. 重新build,成功~

你可能感兴趣的:(使用xcode编译项目build失败(not allowed in a library))