react-native-linear-gradient: library not found for -LBVLinearGradient

Hello everyone, I have a problem and would like to know if you have had the same problem. library not found for -LBVLinearGradient

I already did it

npm install react-native-linear-gradient --save
cd ios
pod install
cd ..
react-native link react-native-linear-gradient

package.json

"react": "16.8.6",
"react-native": "0.59.10",
"react-native-linear-gradient": "2.5.3",

Xcode Version 11.3 (11C29)

I appreciate if someone can help me

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 28
  • Comments: 38 (5 by maintainers)

Most upvoted comments

We’ve managed to fix the issue in our project 🎉 The issue had nothing to do with -LBVLinearGradient, it was just first library “in the order”.

What helped is:

  1. (maybe) Updating XCode to latest version (ATM 11.4)
  2. Changing Build system from Legacy to New build system
Screenshot 2020-04-14 at 10 39 32

Also you should use xcworkspace instead of xcodeproj when building from XCode (I think CLI does this automatically).

Now everything works fine both on our local machines and on CI.


If this doesn’t help, maybe deleting cashes after doing above mentioned steps will. Here is our clear-cache “super script”:

"clear-cache": "npm run clear-xcode-cache && watchman watch-del-all && rm -rf $TMPDIR/react-* && npm cache verify && rm -rf node_modules/ && npm run clear-npm-pod-cache && rm -rf ios/build/ && cd android && ./gradlew clean && cd .. && npm run start-no-cache"

  1. "clear-xcode-cache": "cd ios && bash ../resetXcode.sh && cd../" (will paste code from resetXcode.sh below)
  2. "clear-npm-pod-cache": "rm -rf ios/Podfile.lock && rm -rf package-lock.json && npm run npm-pod-install"
  3. "npm-pod-install": "npm install && npm run pod-install"
  4. "pod-install": "cd ios/ && pod install && cd ..",

resetXcode.sh, huge thanks to maciekish/resetXcode.sh, we have just copied it to our project 😃

I tried everything else for hours, what worked was setting in my Podfile :

platform :ios, '10.0'

The same as the iOS Deployment Target Version in Info.plist. They were different.

This has to match image

This fixed it for me https://github.com/react-native-linear-gradient/react-native-linear-gradient/issues/452#issuecomment-750325305

platform version in Pod File platform :ios, ‘11.0’

had to match with deployment info : deployment version in General.

For my case the problem was pretty simple, I was using cocoapods and not openning my project in Xcode from the .xcworkspace

I have the same issue here, and none of the mentionned fixes solved my issue. RN 0.61.2 with react-native-linear-gradient 2.5.6

Please check if your Pod file platform :ios, ‘11.0’ matches with the minimum deployment target in the XCODE setting…

Got it to work! Not sure which of these steps did it.

  1. In /ios do pod deintegrate then pod install
  2. Remove all Library Search Paths and just add in $(inherited)
  3. Clean build folder
  4. Build

Thanks everyone

Same here:

  • Issue started when upgrading from 0.61.5 to 0.62
  • Did all the common steps:
    • Opened the workspace
    • Cleaned build
    • Ensured that Podfile has correct import

Same issue here

This has to match image

Though It is matching for me, error still persists.

Only if i run code in release mode from xocde by editing schema, error not shows. It is working fine in release mode.

But i want to run the code in debug mode only for testing purpose.

Any other solution?

Thanks for the additional information @puremana - I’ll check this later.

@friederbluemle I’m on react native 0.61.5 and react-native-linear-gradient 2.5.6 and yet I’m having the same issue.

package.json Full error log

I am also experiencing this. Did you manage to find a solution?