[英]React-Native error ld: library not found for -lBVLinearGradient
Installed 'react-native-lienar-gradient' library in my new react-native project.在我的新 react-native 项目中安装了“react-native-lienar-gradient”库。
Added pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' in Podfile在 Podfile 中添加了 pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
Performed pod install in ios directory在 ios 目录中执行 pod install
Xcode build gives the following error: Xcode 构建会出现以下错误:
ld: warning: directory not found for option '-LL/Users/pavneet/Library/Developer/Xcode/DerivedData/Krowym-fttolxdorzfwjbcgjwmxijsnufkv/Build/Products/Debug-iphonesimulator/BVLinearGradient' ld: library not found for -lBVLinearGradient clang: error: linker command failed with exit code 1 (use -v to see invocation) ld:警告:找不到选项“-LL/Users/pavneet/Library/Developer/Xcode/DerivedData/Krowym-fttolxdorzfwjbcgjwmxijsnufkv/Build/Products/Debug-iphonesimulator/BVLinearGradient”的目录:链接器命令失败,退出代码为 1(使用 -v 查看调用)
Tried deleting Podfile.lock, cleaning xcode build, manually linking library by react-native link command, deleting Derived data folder尝试删除 Podfile.lock,清理 xcode 构建,通过 react-native 链接命令手动链接库,删除派生数据文件夹
Also tried by adding libBVLinearGradient.a on Build Phases -> Link Binary With Libraries还尝试在 Build Phases -> Link Binary With Libraries 上添加 libBVLinearGradient.a
Environment环境
react-native:0.63.2反应原生:0.63.2
react-native-linear-gradient:2.5.6反应原生线性梯度:2.5.6
Can you try this.你可以试试这个。
First deintegrate and install the pods again先解体再安装pods
sudo gem update –system
sudo gem install -n /usr/local/bin cocoapods
pod setup
cd ios
pod deintegrate
pod install
And then go back and run the app by deleting ios build and watchman
and clearing metro server and simulator cache
and also deleting and reinstalling node modules
然后通过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-add this in pod file: pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' 1-在 pod 文件中添加:pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
2-npx pod-install 2-npx pod-install
I know this is so late, I hope you've already solved your problem.我知道这么晚了,我希望你已经解决了你的问题。 However, this solution might help someone else.但是,此解决方案可能对其他人有所帮助。
users/${username}/Library/Developer/Xcode/DerivedData
go this directory and clean your project data. users/${username}/Library/Developer/Xcode/DerivedData
转到此目录并清理您的项目数据。 (Make sure hidden files are visible to see Library
file under users/${username}
. Command+Shift+.
combination switches hidden files visibility.) (确保隐藏文件可见以查看users/${username}
下的Library
文件Command+Shift+.
组合切换隐藏文件可见性。)pod deintegrate
and pod install
again. pod deintegrate
和pod install
再次。Library Search Paths
and search.键入Library Search Paths
并搜索。Library Search Paths
and delete the first and the last quote characters.( enter image description here It should look like this.)在Library Search Paths
旁边的路径上单击两次并删除第一个和最后一个引号字符。(在此处输入图像描述它应该是这样的。)Command+B
to build your project.最后按Command+B
来构建你的项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.