Cocoapods: Cocoapods libraries are not compiled for some iOS simulators

Created on 23 Jun 2016  路  13Comments  路  Source: CocoaPods/CocoaPods

It works for, e.g., iPhone6Plus simulator 9.3.0 but not for iPhone5. Why? I have got '$(inhireted)' for other_linker_flags option
THERE ARE A LOT OF ANSWERS ABOUT USING ONLY_ACTIVE_ARCH BUT I DOESN'T HELP. WHY??? I'VE LOST 2 DAYS TO FIND THE SOLUTION!!

file was built for archive which is not the architecture being linked (i386)\

Expanded: For some simulators I receive this error of compiler:

ld: warning: ignoring file /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libFSCalendar.a, file was built for archive which is not the architecture being linked (i386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libFSCalendar.a ld: warning: ignoring file /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libGBDeviceInfo.a, file was built for archive which is not the architecture being linked (i386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libGBDeviceInfo.a ld: warning: ignoring file /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSCLAlertView-Objective-C.a, file was built for archive which is not the architecture being linked (i386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSCLAlertView-Objective-C.a ld: warning: ignoring file /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSSKeychain.a, file was built for archive which is not the architecture being linked (i386): /Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build/Products/Debug-iphonesimulator/libSSKeychain.a Undefined symbols for architecture i386: "_OBJC_CLASS_$_FSCalendar", referenced from: objc-class-ref in VCalendarView.o "_OBJC_CLASS_$_GBDeviceInfo", referenced from: objc-class-ref in VEMailView.o objc-class-ref in DataClass.o "_OBJC_CLASS_$_SCLAlertView", referenced from: objc-class-ref in VAlerts.o "_OBJC_CLASS_$_SCLAlertViewBuilder", referenced from: objc-class-ref in VAlerts.o "_OBJC_CLASS_$_SCLAlertViewShowBuilder", referenced from: objc-class-ref in VAlerts.o "_OBJC_CLASS_$_SSKeychain", referenced from: objc-class-ref in VDescriptionView.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)```

awaiting input

Most helpful comment

I just happened to find the solution: I don't know why, but my settings for Pods Xcode project had the "Build Active Architecture Only" set to YES. Once I removed the setting, it turned to NO and it started working. I hope this revelation might be useful for others as well. I certainly haven't touched that setting myself, I don't know why it was set to "No".

All 13 comments

Please share a project which reproduces the issue, so that we can take a look

I'm also receiving this issue. I am only hitting it when I build for a iPhone 5c, iPhone 5 simulator, etc. I imagine this has to do with how any phone from iPhone 5 and below use a 32-bit architecture.

I can try to create a project with the error, but I know this popped up when I upgraded from cocoapods version 0.39 or so to version 1.x

Also: I had to update my Podfile from ':link_with' to grouping the dependent Pods into a 'def shared_pods' method that I use within each of my targets, removed each target's dependency on libPods.a since Cocoapods 1.x built a library for each target specifically.

A few hours later I found this solution.
I just manually removed

/Users/admin/Library/Developer/Xcode/DerivedData/myApp-ekwldvjyuxwkykbareyvvydbtero/Build

and rebuilt the project. It was launched correctly.

@yurevich1 This worked for me, I had several directories named '[appname]-[different_string_here]'. I just removed them all and I was able to build. Thanks so much!

I'm also having this problem, but deleting the Derived Data isn't fixing the issue. The other part of the question, though-- is this affecting archives or just building for the simulator and 32-bit devices? In other words, has anyone tried distributing an archive that's having this problem, and finding iPhone 5c/5 users unable to run the app?

I have installed version 1.0.1, but my project can not run in iPhone5/5c device or simulator by XCode.

May I ask why is this issue closed? The problem still exists. I had just updated to CocoaPods 1.1.1 to try to see if it solves the issue, but my project won't build. (Building for both Simulator and Device fails.). I have set $(inherited) on all of my targets, and tried cleaning (deleting) the build folder, but it still doesn't work.

Any help would be much appreciated. I have huge respect for the community effort that went into creating and maintaining CocoaPods, but I am strongly considering abandoning it altogether, because I'm getting burned almost every time I add a new library.

This issue was closed because multiple people, including the original author showed that it was a derived data error from Xcode. You're welcome to open a new issue with a reproducible way for us to help debug it.

We create and maintain this in our spare time, with hundreds of thousands of users - you can imagine how that works out WRT our time management.

Thanks for the response, Orta. I know you all build it in your spare time, and I really appreciate it, I do. I will try investigating it some more and possibly open a new issue. The problem is: I don't completely understand how the buliding/linking works, that's why it's hard for me trying to solve it, or even pinpoint where exactly is the problem.

Is there any good resource that you know of which explains this stuff? I'd love to learn more about it. Thank you.

There's not really any canonical apple documentation around this. A good resource for a lot of the underlying build tools is this blog: http://pewpewthespells.com/ramble.html

Thank you Orta, that's great! Especially since I wasn't able to find anything solid on this topic before. I will read up on that :).

I just happened to find the solution: I don't know why, but my settings for Pods Xcode project had the "Build Active Architecture Only" set to YES. Once I removed the setting, it turned to NO and it started working. I hope this revelation might be useful for others as well. I certainly haven't touched that setting myself, I don't know why it was set to "No".

@LukasCZ Hi bro, your solution saved my day, i'm lucky to find the post! Thanks very much.

Was this page helpful?
0 / 5 - 0 ratings