问题
Installed 'react-native-lienar-gradient' library in my new react-native project.
Added pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' in Podfile
Performed pod install in ios directory
Xcode build gives the following error:
ld: warning: directory not found for option '-L-L/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)
Error in Xcode
Tried deleting Podfile.lock, cleaning xcode build, manually linking library by react-native link command, deleting Derived data folder
Also tried by adding libBVLinearGradient.a on Build Phases -> Link Binary With Libraries
Environment
react-native:0.63.2
react-native-linear-gradient:2.5.6
回答1:
Can you try this.
First deintegrate and install the pods again
sudo gem update –systemsudo gem install -n /usr/local/bin cocoapodspod setupcd iospod deintegratepod 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
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
来源:https://stackoverflow.com/questions/64098782/react-native-error-ld-library-not-found-for-lbvlineargradient