问题
I'm getting a error from cocoa pods that I've never seen before. I've had it working with several dependencies just fine. I recently added the TestFlightSDK as a dependency through pods and I'm unable to Archive the project. It builds just fine to devices but refuses to Archive. Has anyone else experienced this issue?
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
My Library Search Paths looks like this (for both debug and release):
$(SRCROOT) recursive
$(PODS_ROOT) recursive
$(inherited) recursive
回答1:
Ok so I found the answer (that worked for me) using some suggestions from this post
I was actually getting a different Warning that I hadn't noticed.
Pods was rejected as an implicit dependency for 'libPods.a' because its
architectures 'armv7 armv7s' didn't contain all required architectures
'armv7 armv7s arm64'
It was actually related to the Pods target not having the correct architectures. It turned out to be a xCode bug after all. In my Pods Target I had all the correct acrhitectures selected, armv7, armv7s, and arm64.
THE SOLUTION:
Update cocoapods to the newest version that supports 64 arch.
sudo gem update cocoapods
Delete all Valid Architectures and do a project clean (which fails alot..)
- Re-Add the architectures that you just removed and voilà!
回答2:
my fault was an old cocoa pods integration. had to delete the pod-.a files in "/Frameworks" folder and pod-.xcconfig in "/Pods".
-> run 'pod install'
everything fine
回答3:
Other solution is if you update your pods with new target, you will check libpods.a, maybe was deleted and system not found it. Make sure that libpods is in your Linked Framework and libraries in General information (where you change version, bundle identifier and build).
回答4:
In my case problem was with Scheme.
- go to Product -> Scheme -> Edit Scheme
- click on Build
- add the Pods static library, and make sure it's at the top of the list
- clean and build again
回答5:
You can fix this issue if this belongs to libraries by selecting your Target, then going to "Build Phases"
in "Link Binary With Libraries"
, and removing ".a"
file of that library. After this Clean and Build.
Hope this helps.
来源:https://stackoverflow.com/questions/21263539/cocoa-pods-error-ld-library-not-found-for-lpods