Error “library not found for”
I’m having a error after I put in my app a admob. yesterday the app worked fine but today it did not worked anymore .. the error is as follows:
ld: library not found for -lGoogleAdMobAds clang: error: linker command failed with exit code 1 (use -v to see invocation)
how to fix it ? thanks !!
13 Solutions Collect From Internet About “Error “library not found for””
Sometimes you just remove the reference of the library and add reference again.
Apart from adding the Google Mobile Ads SDK and other libraries again from scratch, I would recommend you checking the Library Search Paths. There are instances when you copy or duplicate a target, Xcode decides that it needs to escape any double quotes ” with a ‘\’. Make sure you remove all the \’s – it should look like this –
I was able to duplicate the error, by doing prefixing my path with multiple ‘\’.
I had a similar “library not found” issue. However it was because I accidentally was using the
.xcodeproj file instead of the
If error related to Cocoapods as follow:
library not found for -lPod-...
You need to check Other Linker Flags and remove it from there.
Extra Information: If you have an old project that uses cocoapods. And recently you needed to add the use_frameworks! to your podfile.
cocoapods will not add the libraries to your Other Linker Flags
anymore cause its inherited. Therefore, you may need to remove those
manually from the other linker flags which they were added before
using the use_frameworks!
For my case Xcode 7,
ld: library not found for -ldAfnetworking clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build Active architecture Only to
If error is like following
ld: library not found for -lpods
I found that a file “libPods.a” which is in red colour(like missing files) was created somehow in the Framework group of the project. I just simply removed that file and everything got fine.
Select your Target, go to
"Build Phases" in
"Link Binary With Libraries" remove
".a" file of that library.
Clean and Build.
This can also happen if you open project file instead of a workspace. I’ve wasted like a day myself this way.
I know this is a bit old, but I just hit a similar issue and running ‘pod update’ fixed this for me. My library error was with AFNetworking…
Just be careful doing pod update if you don’t use explicit versions in your pod file.
This error is very weird.
I had this error with -ldAfnetworking and I only copy my project in other path and works.
In my case there was a naming issue. My library was called
ios-admob-mm-adapter.a, but Xcode expected, that the name should start with prefix lib. I’ve just renamed my lib to
libios-admob-mm-adapter.a and fixed the issue.
I use Cocoapods, and it links libraries with Other linker flags option in build settings of my target. The flag looks like
Hope it helps someone else
I tried renaming my build configuration
Production, but apparently cocoa pods doesn’t like it. I renamed it again to
Release, and everything builds just fine.
@raurora’s answer pointed me in the right direction. I was including libraries in my “watchkitapp Extension/lib” path. In this case, the Library Search Path needed to be escaped with a ‘\’, but the linker didn’t seem to understand this. To fix / work-around the issue, I moved my lib path up one level so it was no longer in a directory that contained a space in the name.
Late for the answer but here are the list of things which I tried.So it will be in one place if anyone wants to try to fix the issue.
- Valid architecture = armv7 armv7s
- Build Active Architecture only = NO
- Target -> Build Settings ->Other Linker Flags = $(inherited)
- Target -> Build Settings ->Library Search Path = $(inherited)
- Product Clean
- Pod Update in terminal
- Unit Test can't find Core Data model file
- CIFilter output image nil
- Read text file in Swift
- Swift – Call self.navigationController into custom cell class
- How can I update swift from 3.1 to 3.2, but not to 4.0
- Swift : take photo from AVFoundation
- Why push notification is shown when app is foreground? (iOS10 / iPhone 7)
- Convert UTF-8 encoded NSData to NSString
- OpenCV on iOS – GPU usage?
- UIImageWriteToSavedPhotosAlbum does not work in iOS 6 iPad 3
- Segue and Button programmatically swift
- UITextView contentSize changes and NSLayoutManager in iOS7
- Creating retina screenshot programmatically resulting in non retina image
- How to add playable(such as wav,wmv) header with PCM data/buffer in iOS?