0

Serious frustration with CocoaPods and hoping for some kind soul to help me out. I installed two dependencies. Everything built correctly until I made the grave mistake of actually trying to use these dependencies in my code.

In my SubscribeViewController.m file, I add this one simple line (that issues no compiler warnings or errors):

AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];

Then I go to run the project, and this happens:

enter image description here

I saw some potential solutions, such as adding SubscribeViewController.m to my compile sources and changing the valid architectures. Neither of these work. What do I do to get these dependencies to work?

Here is the Podfile:

platform :ios, '7.0'

source 'https://github.com/CocoaPods/Specs.git'

target 'MyProject' do
    pod 'Braintree'
    pod "AFNetworking", "~> 2.0"
end

target 'MyProjectTests' do
    pod 'Braintree'
    pod "AFNetworking", "~> 2.0"
end
Community
  • 1
  • 1
AndroidDev
  • 20,466
  • 42
  • 148
  • 239
  • Are you building from the `.xcodeproj` or `.xcworkscpace`? – Adam Jenkins Nov 05 '14 at 18:08
  • 1
    And this is why I never trust cocoapods with anything ever. I tried it once because people assured me it was as useful as Python's pip, but pip never forced my entire project to be organized in a completely different way. My advise: throw out cocoapods and manually add your dependencies to your project. It's not terribly hard... in fact, I'd argue that even with Cocoapods works perfectly, it's not an improvement over the manual process of adding dependencies. – ArtOfWarfare Nov 05 '14 at 18:10
  • @Adam - xcworkspace. – AndroidDev Nov 05 '14 at 18:15
  • @ArtOfWarfare - I agree with you about CocoaPods, based on my first 24 hours of involvement with it. I'll look into it, but I'm hoping to find a quick solution without having to start fresh. – AndroidDev Nov 05 '14 at 18:17
  • Using this Podfile with a new project works fine. @ArtOfWarfare Unless your dependencies are small and never updated, CocoaPods is certainly worth it. Especially as the number of dependencies grows. It also make importing small dependencies trivial, so you use them more. – Jon Shier Nov 05 '14 at 19:24
  • Well, that's where I have to disagree, @jshier. I appreciate the comment, but after spending all of yesterday afternoon and all day today and still getting absolutely nowhere, the idea of saying that "CocoaPods is worth it" is more than a little debatable. It just doesn't work. At least not for me and not in this situation. This is 24 hours of my life (and counting) that I will never get back. – AndroidDev Nov 05 '14 at 19:39
  • @jshier - Oh boy, automatically updating dependencies in a massive project. I don't see how that could possibly backfire. – ArtOfWarfare Nov 05 '14 at 19:39
  • @ArtOfWarfare It doesn't have to update automatically, it just can. There's flexibility for what versions get updated or not. – Jon Shier Nov 05 '14 at 19:47
  • @usr55410 I don't know what your issue could be. Are you trying to build only for 32-bit? I mostly commonly see that type of error when either trying to build for particular architectures or when accidentally trying to use the xcproj instead of the xcworkspace. Also, was this an existing project or a new one? Using the latest version of CocoaPods (0.34.4). Xcode version? – Jon Shier Nov 05 '14 at 19:48
  • Not trying to build only for 32 bit (rather for all versions). It is an existing project that I need to add some functionality to, which is what the library is for. I just installed CocoaPods yesterday (and again today), so I assume it is the latest version. Thanks! – AndroidDev Nov 05 '14 at 19:58

1 Answers1

0

The AFHttp pod may not have been built for that architecture. I have this in my podfile, so you can try it and see if that helps. I'm writing this up as an answer just for formatting even though I'm not sure if that's the actual solution.

# Remove 64-bit build architecture from Pods targets
post_install do |installer|
  installer.project.targets.each do |target|
    target.build_configurations.each do |configuration|
      target.build_settings(configuration.name)['ARCHS'] = '$(ARCHS_STANDARD_32_BIT)'
    end
  end
end

Can you include your current podfile?

mitrenegade
  • 1,834
  • 18
  • 28
  • This allowed my project to build. However, I get a very concerning compiler warning `Pods-MyProect was rejected as an implicit dependency for 'libPods-MyProject.a' because its architectures 'i386' didn't contain all required architectures 'x86_64'`. Any idea of what the consequences of this might be? I'm not a big fan of leaving compiler warnings unresolved. – AndroidDev Nov 05 '14 at 22:59
  • i believe then you should remove the 64 bit architecture from your build target. See here: http://stackoverflow.com/questions/18881986/integration-error-with-cocoapods-and-xcode5 – mitrenegade Nov 06 '14 at 15:34