最近使用Xcode編譯項(xiàng)目總是失敗,報(bào)如下錯(cuò)誤:-ljcore-ios is not an object file (not allowed in a library)
QQ20171211-135151@2x.png
原因:
經(jīng)發(fā)現(xiàn)是jpush庫(kù)和jcore庫(kù)版本不匹配導(dǎo)致的稚茅,jpush-react-native使用版本1.7.1,jcore-react-native使用版本1.1.8虱颗,可jcore-react-native實(shí)際上使用的卻是1.2.2
解決辦法:
- 在xcode的libraries文件夾劝枣,將RCTJcoreModule.xcodeproj刪掉;
- 使用命令
npm i jcore-react-native@1.1.8 --save
重新安裝jcore庫(kù)朴摊; - 使用命令
react-native link jcore-react-native
重新link葛圃; - 重新build千扔,成功~