Error: Ld: Library Not Found for -Lpods with Cocoapods

Getting `ld: directory not found for option` build error after installing cocoa pod

I realized the issue was that I was still building the .xcodeproj file as shown below:

xcodebuild build-for-testing
-project ProjectName.xcodeproj
-scheme ProjectName
-destination 'platform=iOS Simulator,name=iPhone 12,OS=latest'
-testPlan UnitTests
| xcpretty

But since I was now using cocoa pods in my project, I needed to use the .xcworkspace file to build it:

xcodebuild build-for-testing
-workspace ProjectName.xcworkspace
-scheme ProjectName
-destination 'platform=iOS Simulator,name=iPhone 12,OS=latest'
-testPlan UnitTests
| xcpretty

React native: ios - Library not found for -lbolts

Finally I solved It by change Deployment target version to 12.1 because version are difference between Podfile and Deployment target. Then everything is fine!.

Cocoapods causing library not found and header file not found errors for Xcode Simulator but not device

Update the deployment target and the Podfile 'platform' target. Update both from 9.0 to 11.0. Change this line in your Podfile

platform :ios, '11.0'
and this in both your Target and Project:

Sample Image

ld: library not found for -lRCTAnimation

Can you try to remove all the linked React Native library in Xcode ?

  1. Open Project.xcworkspace file in Xcode
  2. Go to project navigator tab
  3. Go to Build Phases tab
  4. Then under Link Binary With Libraries section: Remove all binaries -libRCT*

With RN 60+ there are now included in the Pods project.



Related Topics



Leave a reply



Submit