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!
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.
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)
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 lidPods.a
dependency.
Make sure you are opening the .xcworkspace file, not the .xcodeproj
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.
I found that selecting "Find implicit Dependencies" (under product / edit scheme) will resolve this issue instead of having to add pods as a target.
Look for "Library Search Path" in you target's Build Settings page. change the folder name of Debug from Debug-iphoneos to Debug-iphonesimulator
There are so many reason caused this problem.
We need to check:
- Build setting
$(inherited)
- Detect all implicit dependencies
- .......
Troubleshooting: http://guides.cocoapods.org/using/troubleshooting.html
Make sure the missing pods library gets actually built. To do so, open the Build Scheme
Product > Scheme > Edit Scheme... > Build
add the Pods target and put it before the target that complained about the library missing (in my case this were the UI tests – I just struggled with this for hours...)
For me the error was: that the Pods target did not contain the required architecture slice for i386. So i clicked on the Pods project --> Pods-ProjectName target, and in Build Settings, turned Build Active Architecture Only to NO for both Debug and Release. This makes sure both the Simulator and Device slices are built. The simulator uses the i386 architecture, and the actual devices use x86-64. So you have to make sure all dependent targets for all dependent projects are building both, if you want to run on both Simulator and side loading to devices also.
When you use App extension, navigate to the extension target, and filter to Library Search Path, delete the path the compiler warning to you.
来源:https://stackoverflow.com/questions/23489920/error-ld-library-not-found-for-lpods-with-cocoapods