Error: ld: library not found for -lPods with CocoaPods
Solution 1
Suggest trying the following, that worked for me:
a) Search from 'Library' from the Target Settings view and double-click to inspect the value of Library Search Paths
b) There are two values listed $(inherited)
and $(PROJECT_DIR)/Pods/build/Debug-iphoneos
. Delete the latter.
c) Do a full clean, build & run
d) Run pod install
again. Notice that the entry is not restored.
Solution 2
Also this may help:
- In your main project (not Pods) select the main target
- Go to the Build Phases tab
- Go to Link Binary with Libraries
- Remove the library that is causing the problem (it would probably be in red color)
Solution 3
Make sure you are opening the .xcworkspace file, not the .xcodeproj
Solution 4
In my linked binaries I had both libPods.a
and libPods-MyProj.a
. I had previously updated my Podfile to have TWO separate targets (to get it compile tests in Swift with bridging), which meant I had to manually delete the old libPods.a
dependency.
Solution 5
I've found that $(inherited)
was missing from my Other Linker Flags build setting. Applying this option fixed a missing library issue I was seeing.
Comments
-
Davis about 3 years
after i installed DTCoreText (https://github.com/Cocoanetics/DTCoreText) with Cocoapods i always get an error when i try to run the simulator or device!
ld: warning: directory not found for option '-L/Users/example/Desktop/ios/Pods/build/Release-iphoneos' ld: warning: directory not found for option '-L/Users/example/Desktop/ios/Pods/build/Debug-iphoneos' ld: library not found for -lPods-example clang: error: linker command failed with exit code 1 (use -v to see invocation)
in my "Link Binary With Libraries" the "libPods" Part is red:
Here are my build Settings:
The Settings of my Project:
The Settings of my Pods:
EDIT:
I´m not exactly sure what was the Problem, but I solved it when i deleted all the DTCoreText and Cocoapods stuff and reeinstalled everything again!