问题描述
在我的新react-native项目中安装了"react-native-lienar-gradient"库.
Installed 'react-native-lienar-gradient' library in my new react-native project.
添加了pod'BVLinearGradient',:path =>Podfile中的'../node_modules/react-native-linear-gradient'
Added pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' in Podfile
在iOS目录中执行pod安装
Performed pod install in ios directory
Xcode构建会出现以下错误:
Xcode build gives the following error:
ld:警告:找不到选项'-L-L/Users/pavneet/Library/Developer/Xcode/DerivedData/Krowym-fttolxdorzfwjbcgjwmxijsnufkv/Build/Products/Debug-iphonesimulator/BVLinearGradient'的目录ld:找不到-lBVLinearGradient的库clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)
尝试删除Podfile.lock,清理xcode构建,通过react-native链接命令手动链接库,删除派生数据文件夹
Tried deleting Podfile.lock, cleaning xcode build, manually linking library by react-native link command, deleting Derived data folder
还尝试通过在构建阶段添加libBVLinearGradient.a->将二进制文件与库链接
Also tried by adding libBVLinearGradient.a on Build Phases -> Link Binary With Libraries
环境
反应本机:0.63.2
react-native:0.63.2
react-native-linear-gradient:2.5.6
react-native-linear-gradient:2.5.6
推荐答案
可以尝试一下.
首先解体并再次安装吊舱
First deintegrate and install the pods again
-
sudo gem update –system
-
sudo gem install -n/usr/local/bin cocoapods
-
pod设置
-
cd ios
-
pod解体
-
pod安装
sudo gem update –system
sudo gem install -n /usr/local/bin cocoapods
pod setup
cd ios
pod deintegrate
pod install
然后通过删除ios build和watchman
,并清除Metro服务器和模拟器缓存
,以及删除并重新安装节点模块,返回并运行应用程序
代码>
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
-
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
这篇关于React-Native错误ld:找不到-lBVLinearGradient的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!