react-native-linear-gradient: library not found for -lBVLinearGradient RN 0.61.5

Hello. Have an issue with library autolonking

xCode version: Version 11.2.1 (11B500) React Native version: 0.61.5

Steps :

  1. Remove Podfile.lock
  2. Remove Pods dir + Build clean && DeliveryData remove
  3. Remove node_modules
  4. yarn install
  5. pod ‘BVLinearGradient’, :path => ‘…/node_modules/react-native-linear-gradient’
  6. cd ios && pod install

Error when archive.:

ld: library not found for -lBVLinearGradient
clang: error: linker command failed with exit code 1 (use -v to see invocation)

P.S. debug build work as expected

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 32

Most upvoted comments

How did you solve this?

UPDATE: check that pod 'BVLinearGradient', :path => '../node_modules/react-native-linear-gradient' is added to your Podfile and you did pod install than open xcworkspace instead of xcodeproj in Xcode and try to build. Worked for me

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

I apologize for not commenting. “Ah sh*t, here we go again”… So, first time I avoided this problem accidentally.

Today I switched to my old commit and this problem here… what a day =( How to fix:

  1. Delete ~/Library/Developer/xCode/UserData and DerivedData
  2. press Clean Project & Build - no result
  3. in ios folder remove “build” folder
  4. press Clean Project & Build - no result
  5. under ios remove folder ‘Pods’ & Podfile.lock & pod install
  6. Clean Project & Build - no result
  7. had some coffee with a cigarette
  8. press Clean Project with pressing ‘option’ button
  9. No result damn.
  10. … waiting for indexing project…looking at wall… what happens knows only Steve…

Finally!!! Its very important! I just close the project and run under Project/ios/mypro.xcworkspace with a double tapping. And WOW -> this is fixed.

Please don’t blame me… we live in a very strange world. A bit of magic =)

FYI: I think steps № 7 and 10 fixed this problem. 100% 😉

Hi @foxbit19 i added also "pod ‘BVLinearGradient’, :path => ‘…/node_modules/react-native-linear-gradient’ " to PodFile but its not working for me. do you have any idea. I am using RN 0-62.2 and when i run react-native run-ios I take his error - react-native-linear-gradient (to unlink run: “react-native unlink react-native-linear-gradient”)

I have tried all the above methods, but none of them worked. Finally, I solved it like this: File - Working Settings,don’t use Legacy Build System image

What fixed it for me was:

  1. Removing pod ‘BVLinearGradient’, :path => ‘…/node_modules/react-native-linear-gradient’ on the Podfile
  2. after pod install / npx pod-install I unlinked react-native-linear-gradient
  3. opened ios/Project.xcworkspace and added libBVLinearGradient.a on Build Phases -> Link Binary With Libraries

Build Phases -> Link Binary With Libraries is now consists of: Screen Shot 2020-08-03 at 1 02 47 PM

I tried doing 1 and 3 it didn’t work. I tried 2 and 3 still didn’t work but when I tried 1, 2 and 3 everything worked out. Hope this will help anyone.

after upgrading from react-native@0.61.5 to react-native@0.62.2 I faced with error again 😦

您好,我已经收到你的来信。Hello,I have received your letter.                                       -----王乐城 mackwang

workport

Unfortunately, for me it is still showing me the same error. Though i also have tried all scenario that you have done. Specially everyone suggesting to open ios/MyProj. xcworkspace and i have opened that one only. Still it is not working. Same error.

Here’s my solution. Hope it helps someone.

My problem arose cause I’m now using Cocoapods along with Fastlane for deploying to the stores.

Since I upgraded from react-native 0.59.10 -> .61.5 I’ve moved from manually linking the libraries to using Cocoapods in my project. My debug version was working fine as I was using .xcworkspace instead of the .xcodeproj file.

I was using Fastlane to make deployments to the store and Fastlane was still pointing to the .xcodeproject instead of .xcworkspace thus it could not find any of the libraries. It just so happens to be that BVLinearGradient was the first library ( alphabetically ) that it could not find and it stopped the gym step process there.

I just updated my GymFile and Fastlane files to target .xcworkspace. and now my release version is working and submitting to the store.

Where to update GymFile and Fastlane files?