Xcode 5 iOS 7 CocoaPods Linker Error
Solution 1
Sounds like you just needed to update cocoapods. For anyone else who doesn't want to solve the problem by simply removing cocoapods from your project, do this:
Check your version of cocoapods:
pod --version
If it's less than 0.25.0, you need to do an update (don't forget "sudo" if necessary):
gem update cocoapods
Make sure your pods are updated:
pod install
Finally, open your .xcworkspace file.
You should be good to go.
Solution 2
I had this problem when experimenting with adding CocoaPods to an existing project.
It turned out that CocoaPods got the Architectures
setting right, but missed on the Build Active Architecture Only
setting. Both must be in perfect sync with your main project, or it will fail when building for a real device (at least if you got more than one ARM arch, which you usually do (armv7, armv7s and now arm64)).
Solved the problem for me, hopefully this will help others with a similar problem.
Solution 3
I just fixed this issue in my workspace. In my case, it wasn't related to upgrading to iOS 7; instead, it was related to archiving for App Store submission. I created an App Store configuration (a duplicate of the Release configuration), and I was trying to use the App Store configuration for the Archive action (configured under Product > Scheme > Edit Scheme... > Archive > Build Configuration). The problem was that I had created an App Store configuration for my app's project, but I hadn't created an App Store configuration for the Pods project (the project that CocoaPods adds to your app's workspace). Once I did this (again, just a duplicate of the Release configuration), the Archive action succeeded.
Solution 4
Variety of reasons why is this happening. This page is really helpful:
http://guides.cocoapods.org/using/troubleshooting.html
For some reason, I changed the workspace build location to Legacy. Changing it back to Custom: Relative to Derived Data solved it for me!
Solution 5
The solution of @john doe (owner of this thread) is correct, you must set up CocoaPods for your project first by running
pod setup
And then
pod install
Related videos on Youtube
john doe
Updated on July 12, 2022Comments
-
john doe almost 2 years
I just upgraded my old project to new iOS 7. It was already using Cocoapods. I compile and run and everything works fine on the simulator and the device. I tried to archive it using Xcode and I get the following error.
ld: library not found for -lPods clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any ideas!
UPDATE:
The architecture for the Pods project is set as the following:
Standard architectures (armv7,armv7s)
SOLUTION:
Cocoapods has been removed from my project. Everything is good now!
-
M.Y. over 10 yearsI encountered ld problem with cocoapods v 0.27.1 (higher than 0.25). This link has helped me stackoverflow.com/questions/6653188/…
-
ilteris over 10 yearsjohn doe, be a good SO and accept kungfuters answer. We all hate cocoapods but still his answer is correct.
-
LightningStryk almost 10 yearsThats not a very good solution.... Remvoing cocoapods.
-
-
john doe over 10 yearsSet the architecture to ..? The Architectures is set to "Standard architectures (armv7,armv7s). Still gives the same exact error.
-
MatthiasC over 10 yearsCould you be a bit more explicit, please? Set the architecture to which values? As it stands, this answer does not help much.
-
MattSenter over 10 yearsA downvote and no comment? Classy. Especially considering this is a completely valid alternative if you DON'T want to uninstall cocoapods.
-
Guillermo Ceballos over 10 yearsAbsolutely right! I was under 0.24.0 version and it wasn't working, just took these steps and now is working well.
-
RyanWilcox about 10 yearsGood call, this was my problem. Especially since I have a 32bit version of my app (thanks, third party dependency!) running on a 64bit iPad. 10 INTERNET POINTS FOR YOU!
-
EdGs about 10 yearsThis actually helped me solve my issue. All I had to do was to say 'YES' on 'Build Active Architecture Only' for my Release configuration.
-
Accatyyc about 10 yearsWow, this actually worked! Thanks for this, it was driving me crazy. Should submit this to CocoaPods, it's weird that you must have a configuration with the same name.
-
Glen Selle over 9 years@johndoe is not the "owner" of this thread but the OP (original person)
-
Gordon Tucker over 9 yearsThis lead me to stackoverflow.com/q/26287103/174469 which solved the rest of the issue for me.
-
theLastNightTrain over 8 yearsOP = Original Poster, or sometimes Original Post.