在我的新 react-native 项目中安装了“react-native-lienar-gradient”库。
在 Podfile 中添加了 pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient'
在 ios 目录中执行 pod install
Xcode 构建给出了以下错误:
ld:警告:找不到选项“-L-L/Users/pavneet/Library/Developer/Xcode/DerivedData/Krowym-fttolxdorzfwjbcgjwmxijsnufkv/Build/Products/Debug-iphonesimulator/BVLinearGradient”的目录
ld:未找到 -lBVLinearGradient 的库
clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
Error in Xcode
尝试删除 Podfile.lock,清理 xcode 构建,通过 react-native 链接命令手动链接库,删除派生数据文件夹
还尝试在 Build Phases -> Link Binary With Libraries 上添加 libBVLinearGradient.a
环境
react 原生:0.63.2
react 原生线性梯度: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
关于ios - react native 错误 ld : library not found for -lBVLinearGradient,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64098782/