Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-Native error ld: library not found for -lBVLinearGradient

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

like image 769
Abhimanyu Patil Avatar asked Jul 31 '26 04:07

Abhimanyu Patil


2 Answers

Can you try this.

First deintegrate and install the pods again

  1. sudo gem update –system
  2. sudo gem install -n /usr/local/bin cocoapods
  3. pod setup
  4. cd ios
  5. pod deintegrate
  6. 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

  1. cd ..
  2. 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
    
like image 65
Glitch_Znab Avatar answered Aug 02 '26 20:08

Glitch_Znab


The version in pod file was platform :ios, '11.0', but the deployment version was 9.0. Changed to 11.0 and the app could be achieved! enter image description here

like image 36
Chaki_Black Avatar answered Aug 02 '26 20:08

Chaki_Black



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!