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

自古美人都是妖i 提交于 2021-02-05 11:58:21

问题


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

  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
    


来源:https://stackoverflow.com/questions/64098782/react-native-error-ld-library-not-found-for-lbvlineargradient

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!