When the app builds it gives the following error message:
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It used to work just fine! I am now targeting iOS 7 and Cocoapods is running into errors.
I think the Pods static library target is being skipped at the beginning of the build because of the configuration does not include 64bit arm.
The latest Cocoapods fixes this.
That is what my hunch tells me as well. I'm closing the issue until further information is provided.
Hi,
Thanks! I have already update the cocoapods gem but still it gets the same error: Here are some more details:
Ld /Users/azamsharp/Library/Developer/Xcode/DerivedData/VegetableTree-aktfvmbkhiktaqdmujjksoyvammb/Build/Intermediates/VegetableTree.build/Debug-iphoneos/VegetableTree.build/Objects-normal/armv7/VegetableTree normal armv7
cd "/Users/azamsharp/Documents/VT New Work/VegetableTree"
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/azamsharp/Library/Developer/Xcode/DerivedData/VegetableTree-aktfvmbkhiktaqdmujjksoyvammb/Build/Products/Debug-iphoneos -F/Users/azamsharp/Library/Developer/Xcode/DerivedData/VegetableTree-aktfvmbkhiktaqdmujjksoyvammb/Build/Products/Debug-iphoneos -filelist /Users/azamsharp/Library/Developer/Xcode/DerivedData/VegetableTree-aktfvmbkhiktaqdmujjksoyvammb/Build/Intermediates/VegetableTree.build/Debug-iphoneos/VegetableTree.build/Objects-normal/armv7/VegetableTree.LinkFileList -dead_strip -ObjC -lsqlite3 -framework CoreGraphics -framework MobileCoreServices -framework QuartzCore -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -framework MapKit -framework CoreLocation -framework Social -framework Twitter -framework MessageUI -framework UIKit -framework Foundation -framework CoreGraphics -lPods -Xlinker -dependency_info -Xlinker /Users/azamsharp/Library/Developer/Xcode/DerivedData/VegetableTree-aktfvmbkhiktaqdmujjksoyvammb/Build/Intermediates/VegetableTree.build/Debug-iphoneos/VegetableTree.build/Objects-normal/armv7/VegetableTree_dependency_info.dat -o /Users/azamsharp/Library/Developer/Xcode/DerivedData/VegetableTree-aktfvmbkhiktaqdmujjksoyvammb/Build/Intermediates/VegetableTree.build/Debug-iphoneos/VegetableTree.build/Objects-normal/armv7/VegetableTree
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is the Podfile:
platform :ios, '7.0'
pod 'FMDB'
pod 'AFNetworking'
pod 'MBProgressHUD'
pod 'CKCalendar'
pod 'SVSegmentedControl'
pod 'REMenu', '~> 1.2.1'
pod 'TSMessages'
Hopefully, the above details help! Please let me know what can I provide further.
For some reason I cannot reopen this issue! Should I submit a new issue with the same content.
Reading it again this error appears to be related to Xcode not being able to find the Pods library. I would check that:
If those are not the cause of the issue it might be an architecture mismatch and I would suggest to select your target in Xcode and validate it settings (Editor menu).
For some reason I cannot reopen this issue! Should I submit a new issue with the same content.
Please no, this issue tracker is reserved to the development of the tool (open issues = things to implement) in future please use StackOverflow or the mailing list.
Thanks for the reply!
you are using the workspace
YES
the Pods library builds
YES
the Pods library is referenced in the products group of your project
The Products folder in my project only has the file which represents my project. "MyProject.app". There is no Cocoapods file in the Products folder.
your target includes the Pods library in the link with frameworks build phase
YES
the Pods library is referenced in the products group of your project
The Products folder in my project only has the file which represents my project. "MyProject.app". There is no Cocoapods file in the Products folder.
Sorry the framework
s group.
It is added in the frameworks group but it is red in color. I saw your posting on
https://github.com/CocoaPods/CocoaPods/pull/1352
Where you indicated about deleting the architecture. Not sure if I understand that deleting the architecture means.
My Project architecture is "Standard architecture (armv7, armv7s) , the pods project has the same architecture.
One of the warnings I saw was "Pods was rejected as an implicit dependency for 'libPods.a' because its architecture 'x86_64' did'nt contain all required architectures 'i386 x86_64'
One of the warnings I saw was "Pods was rejected as an implicit dependency for 'libPods.a' because its architecture 'x86_64' did'nt contain all required architectures 'i386 x86_64'
Bingo!
Where you indicated about deleting the architecture. Not sure if I understand that deleting the architecture means.
CocoaPods now matches the user architecture by default. However it doesn't match the build only for active architecture setting which should be the cause of your issue. I suggest to set it as in CocoaPods which should be the same suggestion of the build settings validation.
I followed the following steps:
Go to Product > 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
The pods was missing in the list so I added it and moved it to the top of the list. Now when I run I get the following:
ld: 107 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1
This is not needed.
Thanks!
You said >> I suggest to set it as in CocoaPods which should be the same suggestion of the build settings validation.
I am having a hard time understanding what it means. My Pods project has the following build settings:
Architectures: Standard architectures (armv7, armv7s)
Base SDK: Latest iOS (iOS 7.0)
Build Active Architecture Only: YES
Supported Platforms: iOS
Valid Architectures: arm64 armv7 armv7s
Everywhere on the forums they are saying that delete the architectures. What does that mean? How can I delete the architectures? If I click on the architectures setting and press "Delete" button nothing happens.
If I click on the architectures setting and press "Delete" button nothing happens.
This mean that they already are the default.
Your issue should be about making the settings of the CP target match with the ones of your target. If those that you listed match I can't help you further as it is something else.
What does CP target stands for?
CP = Current Project
CP = CocoaPods :smile:
Hi, is there any news. I still stuck in this issue when I cannot build or run the app in real device. I have updated cocoapods to version 0.25 but no luck.
hey guys I tried to update cocoapods and now I get this error
fatal: ambiguous argument 'xcode-5-support': unknown revision or path not in the working tree.
Any ideas?
@huyaloha Be sure to read the notes for Xcode 4 users in the CHANGELOG, it might also apply if you’re migrating a project from Xcode 4 to 5. Is that your situation?
@andrespch It sounds like you were using an unreleased CocoaPods. You no longer need to do that, just install the latest gems. E.g. gem install cocoapods
.
That was the name of the development branch for the feature. You should edit or delete your Gemfile.
—
Sent from Mailbox for iPhone
On Wed, Sep 25, 2013 at 8:27 PM, Eloy Durán [email protected]
wrote:
@huyaloha Be sure to read the notes for Xcode 4 users in the CHANGELOG, it might also apply if you’re migrating a project from Xcode 4 to 5. Is that your situation?
Reply to this email directly or view it on GitHub:
https://github.com/CocoaPods/CocoaPods/issues/1400#issuecomment-25112305
For those of who are asking if I resolved the problem. The answer is NO. Unfortunately, I had to take out Cocoapods from my project.
Thanks guys, with a little help from a friend I ended up fixing it by
setting on the pods project "Build active architechtures only" to no. and
then the standard architechtures for both the targets and the project.
Hope this helps someone.
2013/9/25 Fabio Pelosin [email protected]
That was the name of the development branch for the feature. You should
edit or delete your Gemfile.—
Sent from Mailbox for iPhoneOn Wed, Sep 25, 2013 at 8:27 PM, Eloy Durán [email protected]
wrote:@huyaloha Be sure to read the notes for Xcode 4 users in the CHANGELOG,
it might also apply if you’re migrating a project from Xcode 4 to 5. Isthat your situation?
Reply to this email directly or view it on GitHub:
https://github.com/CocoaPods/CocoaPods/issues/1400#issuecomment-25112305—
Reply to this email directly or view it on GitHubhttps://github.com/CocoaPods/CocoaPods/issues/1400#issuecomment-25113238
.
@andrespch Did you try to change the value in _your_ app target instead as indicated in the CHANGELOG ?
@alloy You saved my life. It works when I change the Build Active Architecture Only to same as in Pods.
@andrespch that worked for me, thanks!
i just ran into the same problem today when changing
platform :ios, '6.0'
to
platform :ios, '7.0'
I did check my "Build Active Architecture Only" Settings on both my project and the pod project and they are the same...
"Apple Mach-O Linker Error" because of "Undefined symbols for architecture i386"
I even deleted the workspace, the podfile.lock and the pods folder and reinstalled using
pod install
but still my app won't compile any more
and help is very much appreciated!
Also ensure the ARCHS setting on your project/target is set. See https://github.com/CocoaPods/CocoaPods/wiki/FAQ#running-into-build-failures-after-migrating-to-xcode-5-and-cocoapods-0250.
I have the ARCHS settings in my project set
The settings are the same on the pod project as well as my actual project.
I also tried out including the 64bit version as well as without. Still the error is present when compiling.
Undefined symbols for architecture i386
....
@georgbachmann Does any of your pods include a vendored library or framework?
@irrationalfab I don't really know...
I just had a look at my errors and most of them are related to
pod 'MagicalRecord'
pod 'SDWebImage'
pod 'AFNetworking', '~> 1.2.1'
f.e.:
"_kCGImagePropertyPixelHeight", referenced from:
-[SDWebImageDownloaderOperation connection:didReceiveData:] in libPods.a(SDWebImageDownloaderOperation.o)
"_UTTypeCopyPreferredTagWithClass", referenced from:
_AFContentTypeForPathExtension in libPods.a(AFHTTPClient.o)
"_NSMergeByPropertyObjectTrumpMergePolicy", referenced from:
+[NSManagedObjectContext(MagicalRecord) MR_setRootSavingContext:] in libPods.a(NSManagedObjectContext+MagicalRecord.o)
Thanks for helping!
I still can't compile my project if I do a 'pod update'
would be so great if someone could help me... i'd really like to update my cocoapods
Still tons of messages like those:
Undefined symbols for architecture i386:
"_NSInMemoryStoreType", referenced from:
-[NSPersistentStoreCoordinator(MagicalRecord) MR_addInMemoryStore] in libPods.a(NSPersistentStoreCoordinator+MagicalRecord.o)
"_NSInferMappingModelAutomaticallyOption", referenced from:
+[NSPersistentStoreCoordinator(MagicalRecord) MR_autoMigrationOptions] in libPods.a(NSPersistentStoreCoordinator+MagicalRecord.o)
all of them are Apple Mach-O Linker Errors
@georgbachmann This issue appears to be related to modules. Can you confirm that disabling them in the target of the Pod fixes the build?
Just to test that i removed the MagicalRecords out of the target and got less errors, that's correct.
Errors remain for f.e. DropboxSDK, TestFlightSDK
But as I need f.e. MagicalRecords in my project I can't disable the in my pod-target....
To be clear I was referring to disabling modules in the build settings of the target. Not removing the target.
Ah, ok... I didn't get that...
When searching for "module" in my Pods' build settings I can see one called "Enable Modules (C and Obj-C)"
I tried building with it set to YES as well as NO but it's the same error with both settings...
But then I had a closer look at my errors and from 49 build errors i managed to get down to 6...
I included MagicalRecord which through the Pod-Project imported the "CoreData" Framework for me. Now I had to do it myself in my main Project... Same with "MobileCoreServices"....
Now there are 6 errors remaining which I don't understand why I get them....
One is caused by a TFLog (which comes from the TestFlight pod....)
"_TFLog"
"_OBJC_CLASS_$_TestFlight"
And the others seem to be caused from the Dropbox-iOS-SDK pod...
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_DBRestClient"
"_OBJC_CLASS_$_DBSession"
"_kDBRootDropbox"
"_OBJC_CLASS_$_TestFlight"
Any ideas how I could get rid of them? As they seem to be coming from the pods, I don't think including another framework would help here?!?
Thank you for helping me...
Adding frameworks manually? I think tha your build settings are overriding CocoaPods ones. Check that the value of the xcconfig end up in your target.
—
Sent from Mailbox for iPad
On Fri, Oct 18, 2013 at 4:41 PM, georgbachmann [email protected]
wrote:
Ah, ok... I didn't get that...
When searching for "module" in my Pods' build settings I can see one called "Enable Modules (C and Obj-C)"
I tried building with it set to YES as well as NO but it's the same error with both settings...
But then I had a closer look at my errors and from 49 build errors i managed to get down to 6...
I included MagicalRecord which through the Pod-Project imported the "CoreData" Framework for me. Now I had to do it myself in my main Project... Same with "MobileCoreServices"....
Now there are 6 errors remaining which I don't understand why I get them....
One is caused by a TFLog (which comes from the TestFlight pod....)
"_TFLog"
"_OBJC_CLASS_$_TestFlight"
And the others seem to be caused from the Dropbox-iOS-SDK pod...
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_DBRestClient"
"_OBJC_CLASS_$_DBSession"
"_kDBRootDropbox"
"_OBJC_CLASS_$_TestFlight"
Any ideas how I could get rid of them? As they seem to be coming from the pods, I don't think including another framework would help here?!?Thank you for helping me...
Reply to this email directly or view it on GitHub:
https://github.com/CocoaPods/CocoaPods/issues/1400#issuecomment-26600964
I checked my settings and it seems as if the Pod xcconfig is at least used in my project.
What I don't get is that I never changed any build settings whatsoever on my own...
Each target should use a configuration, generated by CocoaPods, named after itself. Definitely your set looks not correct. As this is not the place to discuss usage questions please submit any further question to Stack Overflow or to the mailing list, after having a check to the documentation at http://docs.cocoapods.org.
I also had a problem using CocoaPods and the MagicalRecord pod that suddenly stopped working and as per the comment from georgbachmann, adding the CoreData framework to my target fixed it.
@cjvraay Then probably the podspec needs an update ;)
I fixed that issue by setting the architectures in the Pod target the same as the architecture on my project target (see attached screenshot)
That was working fine, but for somehow, the architecture on the Pod target got changed. Just make sure its the same as your app target architecture.
Please read the answer in the troubleshooting guide.
I just installed cocoapods, and I have this issue with this as podfile and a completely new XCode "single view"-project.
platform :ios, '7.0'
pod 'RestKit', '~> 0.20.0'
ios, '5.0' or '7.0' doesn't seem to matter, but my deployment target is 7.0
Screenshot of Pods-settings:
Screenshot of new project settings (they are all at their default):
Steps to reproduce:
Create a new XCode iOS "Single View"-Project
Create the podfile && pod install
open ThatProject.xcworkspace
Try to build it, fails with "ld: library not found for -lPods"
@NickNick see my reply, I had exactly the same error when trying to archive my app https://github.com/CocoaPods/CocoaPods/issues/1400#issuecomment-33935333
@mal3k In the screenshots I posted, the architectures are the same, right?
Step 4 of http://guides.cocoapods.org/using/troubleshooting.html#using-the-cocoapods-project resolved this issue for me. When/why is it necessary? Isn't the Pods-target something XCode should automatically find, because it's in the same workspace? Like in CMake?
I tried the suggested resolution in the troubleshooting guide, but it still isn't working. Our target has both ARCHS and VALID_ARCHS set to just arm7 (limited by a library we use). Build active archs is set to true for debug. So when we build, I think the pods project is building the arm64 arch (because I'm trying to run it on my 5s), but my project is building arm7. I think I'm following all the recommendations (ensure my target has an ARCHS setting, ensure my target's Build Active Archs is true for debug to match the pods project setting), but still no go.
Unfortunately I cannot set my project's ONLY_ACTIVE_ARCH to YES otherwise if fails to install to the iPhone 5S due to using arm64 as the active architecture(some of our 3rd party frameworks are not arm64 yet). Is there any way I can tell cocoapods to set the ONLY_ACTIVE_ARCH to NO in the Podfile?
To modify the Pods Xcode project you can use the post_install
hook http://guides.cocoapods.org/syntax/podfile.html#post_install.
Alloy thanks for the tip that does exactly what I needed!
It also worked for me. I cannot build with 64 bits because of a third party library. As pointed out by @alloy, Adding these lines in my Podfile fixes the build issue:
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['VALID_ARCHS'] = 'armv7 armv7s'
config.build_settings['ARCHS'] = 'armv7 armv7s'
end
end
end
However, CocoaPods complains about multiple values found:
[!] Found multiple values (`armv7`, `armv7s`) for the architectures (`ARCHS`) build setting for the `Pods` target definition. Using the first.
Any idea how to fix this?
@pbernery We have the same issue as others with 3rd party libs. Here's how we did it and thus kept arm64 support in our main project -
post_install do |installer_representation|
installer_representation.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end
--Edit--
That also resolves the warning you see in your logs.
I'm using XCode 6 Beta 2 with the latest RestKit Pod and had the error about not finding -lPods. Following the troubleshooting steps didn't help. I realized it might be due to my duplicating the release configuration into one for "Ad Hoc". I usually have an Ad Hoc as well as a TestFlight configuration to keep them separate from Release.
Setting the Archive setting in the Scheme of both the Pods target and the app target to Release instead of my Ad Hoc configuration allowed the archive to be built.
Not sure if that is an XCode 6 specific problem or if this happens in XCode 5 as well. I never used CocoaPods before XCode 6 beta.
@dethell when you duplicated your configuration to add te "AdHoc" config did you also think of adding it in your Podfile as we'll especially to tell CocoaPods to consider this configuration as if it was a "Release"?
IIRC the syntax should be sthg like that (see the guides here):
xcodeproj 'yourproject', 'Ad Hoc' => :release
No I didn't. I'll try that.
On Monday, July 7, 2014, AliSoftware [email protected] wrote:
@dethell https://github.com/dethell when you duplicated your
configuration to add te "AdHoc" config did you also think of adding it in
your Podfile as we'll especially to tell CocoaPods to consider this
configuration as if it was a "Release"?IIRC the syntax should be sthg like that (see the guides):
workspace 'yourworkspace', 'AdHoc' => :release
—
Reply to this email directly or view it on GitHub
https://github.com/CocoaPods/CocoaPods/issues/1400#issuecomment-48252096
.
@pbernery @msmollin this works for me too:
post_install do | installer |
installer.project.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
Targets inherit this setting.
Yes, adding the :release config line for my ad hoc build fixed this problem.
On Monday, July 7, 2014, AliSoftware [email protected] wrote:
@dethell https://github.com/dethell when you duplicated your
configuration to add te "AdHoc" config did you also think of adding it in
your Podfile as we'll especially to tell CocoaPods to consider this
configuration as if it was a "Release"?IIRC the syntax should be sthg like that (see the guides):
workspace 'yourworkspace', 'AdHoc' => :release
—
Reply to this email directly or view it on GitHub
https://github.com/CocoaPods/CocoaPods/issues/1400#issuecomment-48252096
.
Very good Mal3k: your solution worked for me.
this solution:
post_install do | installer |
installer.project.build_configurations.each do |config|
config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
does not work for me
everytime i update the pods, i have to manually change the active architecture to NO
is it possible to make it automatic somehow
Most helpful comment
I fixed that issue by setting the architectures in the Pod target the same as the architecture on my project target (see attached screenshot)
That was working fine, but for somehow, the architecture on the Pod target got changed. Just make sure its the same as your app target architecture.
