Error "library not found for" after putting application in AdMob
Solution 1
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 '\'.
Solution 2
I had a similar "library not found" issue. However it was because I accidentally was using the .xcodeproj
file instead of the .xcworkspace
file.
Solution 3
Select your Target, go to "Build Phases"
in "Link Binary With Libraries"
remove ".a"
file of that library.
Clean and Build.
Solution 4
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!
Solution 5
For my case Xcode 7, also worked in Xcode 9.1/9.2
ld: library not found for -ldAfnetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
set Build Active architecture Only
to Yes
Related videos on Youtube
ViniciusPV
Updated on February 15, 2022Comments
-
ViniciusPV over 2 years
I am getting an error after I put my application in an AdMob. The app was working until today. The error is the following:
ld: library not found for -lGoogleAdMobAds clang: error: linker command failed with exit code 1 (use -v to see invocation)
How can I fix this? Thank you.
-
nmh about 10 yearsTry this: stackoverflow.com/questions/1471968/…
-
Aakil Ladhani over 8 years
-
TheTiger about 6 yearsSometimes: Unplug your device and first build the project. It will generate libraries and then you will be able to run in device.
-
-
Mayur Deshmukh over 8 yearsI have many flags here, should I remove all or just the one for the Pod?
-
hasan over 8 yearsIf those flags causes a problem. you should remove them or keep them and add the library if you still want to use it.
-
Jabbar almost 8 yearsWhat about when we need to create a Production build for App Store? I mean it should be NO for Production Build.
-
Ted almost 8 yearsagree it should be NO for production
-
Jabbar almost 8 yearsWill this NO effect on Production Build Installation?
-
Eduardo Oliveros almost 8 yearsi remove that but doesn't work, mix panel its the problem
-
hasan over 7 yearsI guess that happens when you try to remove the library that is added by cocoa pods manually. The correct way is to remove the library from your podfile. then you run pod install again
-
Eva Madrazo over 7 yearsThanks!! This was a clue for me :). In my case, the duplicate target has divided every -l"framework" in two lines "-l" and "framework" !!
-
brainray about 7 yearsYup, strange enough that Xcode doesn't mark it missing by coloring it red
-
Romain TAILLANDIER about 7 yearsyou also could have rename the target in the podfile.
-
Aakash Aggarwal over 6 yearsWorked for me while integrating Pinterest SDK on XCode 9.2 and iOS 11.
-
edenwaith over 6 yearsThis fixed my particular problem. I had two similar named libraries, one named
libPods-Foo BarTests.a
and another one namedlibPods-FooBarTests.a
. -
InnisBrendan over 6 yearsI found references to AWS pods I just removed from my project here. Thanks
-
Prince Kumar Sharma about 6 yearsgood one, after pod install, one of the library was not listed there. I don't know why but adding that library path makes it work.
-
Ian Steffy about 6 years@EvaMadrazo This happened with me too. Did you delete all but one "framework" or just combine them into one line?
-
Eva Madrazo about 6 years@IanSteffy just combine it
-
EFreak almost 6 yearsCan somebody please explain the purpose of .xcodeproj and .xcworkspace?
-
Mark almost 6 yearsThings like this make me love the Javascript ecosystem
-
Jose Pose S almost 6 yearsReally nice!! my problem was when I added user framework to old project. Remove coreplot.a and works fine!!!!
-
Brayan Loayza almost 6 yearsHow i can change that..?
-
Azam over 5 yearsxcworkspace is when you use Cocoapods. It's not Xcode problem, but the users.
-
ZedTuX about 5 yearsWell this fixed my issue "Library not found for -lART" and it's really unbelievable ! Thank you !
-
Will almost 5 yearsffs I wasted a good 5 hours earlier this afternoon because I didn't realize the difference. -_-
-
Luat Vu Dinh almost 5 yearsConsider "Header Search Paths" too.
-
Daniel Benedykt over 4 years.xcworkspace is when you have more than 1 "project" inside your solution. For example you can have external libraries (cocoapods) or your own library that you use in many projects.
-
Flacito over 4 yearsThis gets me about once every 6 months with XCode. It's especially a problem with react-native and other similar Pods heavy apps. You need the workspace not the project.
-
MathMax about 4 years@raurora How do you access library search paths?
-
raurora about 4 years@MassimoFrittelli Project > Build Settings tabs > Search Paths. You can type on the search option too.
-
Nathanael almost 3 yearsThis is what I needed - Thank you!
-
Papyrus over 2 yearsThis happened to me when I updated a pod project to XCode 13 relating to the Nimble framework that the previous version Cocoapod tool (used to create the workspace) stuck into the Podfile at a specific version. This made
pod update
not fix it right away, I had to replacepod 'Nimble', '~> X.Y.Z'
with justpod 'Nimble'
which updated Nimble to the latest version which solved my problem.