2

I'm trying CocoaPods for the first time, because I've inherited a project that relies on it for several libraries. Articles like this one make it sound like it should all Just Work, even in the simulator.

But it's not working for me — I get an "Undefined symbols for architecture i386" for every class defined in a pod library. Moreover,there are a bunch of ld warnings along the lines of "ld: warning: ignoring file blah/blah/Build/Products/Debug-iphonesimulator/SocketRocket/libSocketRocket.a, file was built for archive which is not the architecture being linked (i386)". I get one of these for each CocoaPods library.

How do I get Xcode to build the pod libraries for the simulator (or link the correct ones, if they're being built)?

Joe Strout
  • 2,634
  • 2
  • 28
  • 39
  • Once you install the pods with `pod install` are you making sure to open the `ProjectName.xcworkspace` and not the `ProjectName.xcodeproj` file? – Pratik Patel Jan 25 '17 at 16:40

2 Answers2

4

OK, I've managed to make it work, though I don't know if it requires both of these steps:

  1. Deleted the derived data, as suggested here
  2. In the Pods project, changed "Build Active Architectures Only" to "No" for Debug as well (it was already set to No for Ad Hoc and Release), as suggested by some of the comments here.

I know that step 1 alone didn't do it... but I don't know whether step 2 by itself would have sufficed. Certainly both of them together did the trick for me.

Community
  • 1
  • 1
Joe Strout
  • 2,634
  • 2
  • 28
  • 39
  • I already had these set and ran into a different issue. I've added my answer merely to complement your answer, which is the correct answer. – Jacksonkr Aug 23 '17 at 15:48
0

Adding this answer in case it's helpful to anyone.

To my surprise, it was the simulator version that I was using; iPhone 5 wasn't supported. Xcode gave me no sign of this until I switched to an iPhone 6 simulator, which worked. When switching back to iPhone 5, Xcode then complained that "MyApp does not have an architecture that iPhone 5 can execute."

This is all true and I knew that, but I didn't think of it as the previous error Xcode was giving me was that -lPods-MyApp was missing.

Jacksonkr
  • 31,583
  • 39
  • 180
  • 284