![](/img/trans.png)
[英]using React-native init, a new iOS app can't build in Xcode, build error 'ld: library not found for -lDoubleConversion
[英]React-Native error ld: library not found for -lBVLinearGradient
在我的新 react-native 项目中安装了“react-native-lienar-gradient”库。
在 Podfile 中添加了 pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
在 ios 目录中执行 pod install
Xcode 构建会出现以下错误:
ld:警告:找不到选项“-LL/Users/pavneet/Library/Developer/Xcode/DerivedData/Krowym-fttolxdorzfwjbcgjwmxijsnufkv/Build/Products/Debug-iphonesimulator/BVLinearGradient”的目录:链接器命令失败,退出代码为 1(使用 -v 查看调用)
尝试删除 Podfile.lock,清理 xcode 构建,通过 react-native 链接命令手动链接库,删除派生数据文件夹
还尝试在 Build Phases -> Link Binary With Libraries 上添加 libBVLinearGradient.a
环境
反应原生:0.63.2
反应原生线性梯度:2.5.6
你可以试试这个。
先解体再安装pods
sudo gem update –system
sudo gem install -n /usr/local/bin cocoapods
pod setup
cd ios
pod deintegrate
pod install
然后通过deleting ios build and watchman
并clearing metro server and simulator cache
以及deleting and reinstalling node modules
返回并运行应用程序
cd ..
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -fr $TMPDIR/metro-cache* && rm -fr $TMPDIR/haste-map-metro* && rm -rf ios/build && xcrun simctl erase all && rm -rf node_modules/ && npm cache verify && npm install && react-native run-ios -- --reset-cache
1-在 pod 文件中添加:pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
2-npx pod-install
我知道这么晚了,我希望你已经解决了你的问题。 但是,此解决方案可能对其他人有所帮助。
users/${username}/Library/Developer/Xcode/DerivedData
转到此目录并清理您的项目数据。 (确保隐藏文件可见以查看users/${username}
下的Library
文件Command+Shift+.
组合切换隐藏文件可见性。)pod deintegrate
和pod install
再次。Library Search Paths
并搜索。Library Search Paths
旁边的路径上单击两次并删除第一个和最后一个引号字符。(在此处输入图像描述它应该是这样的。)Command+B
来构建你的项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.