3

Using the new iOS 7 Beta and downloading the latest version of AFNetworking, I went to File>Add Files to Project, and passed in the directory AFNetworking.framework. Now I'm getting a slew of linker errors. For a sanity check, I rolled back the commit history to iOS 6 and everything compiled successfully. Here's the log:

    Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_AFHTTPClient", referenced from:
      _OBJC_CLASS_$_CloudGlyphAPIClient in CloudGlyphAPIClient.o
  "_OBJC_CLASS_$_AFJSONRequestOperation", referenced from:
      objc-class-ref in CloudGlyphAPIClient.o
  "_OBJC_METACLASS_$_AFHTTPClient", referenced from:
      _OBJC_METACLASS_$_CloudGlyphAPIClient in CloudGlyphAPIClient.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Do I need to wait for AFNetworking to get up-to-date with the next version of iOS or is this an architecture issue?

Thanks

roguequery
  • 964
  • 13
  • 28
  • 1
    This is not quite an iOS 7 question. `AFNetworking` is not part of iOS, it's a 3rd-party framework. If you have linker errors, then make sure you have added the framework properly to you project and that all of the required architectures are present in the static library. –  Jun 11 '13 at 20:45
  • I'd wait for an update of AFNetwork – Birdy Jun 11 '13 at 20:46
  • Looking closer, it looks like i tripped a min-OS version error in AFNetworking: – roguequery Jun 11 '13 at 20:53
  • This tripped after compiling: #pragma message("MobileCoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available.") #else – roguequery Jun 11 '13 at 20:54
  • I loaded the AFNetworking dir with the "Add Other" framework button and it shows up under the FRameworks dir. I think everything is linked correctly.. the architecture error is vexing – roguequery Jun 11 '13 at 21:01
  • Another note, im getting flak from the FacebookSDK saying it wasn't compiled for the version i'm trying of iOS – roguequery Jun 11 '13 at 21:02
  • 2
    iOS7 was released yesterday and you would like that everything works fine? moreover with third-party libs? seriously? – oiledCode Jun 11 '13 at 23:17
  • I don't know what's wrong with your AFNetworking.framework bundle, but I can tell you that the project itself compiles and passes the tests in iOS 7. – Jano Jun 11 '13 at 23:58

1 Answers1

5

AFNetworking compiles and loads fine for me on iOS 7. The easiest solution would be for you to set up CocoaPods, and include AFNetworking that way.

See this answer for instructions on making sure the file is included in your target. This answer will explain all the pieces of the error message to you.

iOS 7 is probably a red herring, but if AFNetworking was working before (you didn't say), you may want to file a bug report if your libraries got unlinked when you upgraded.

Community
  • 1
  • 1
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
  • I forgot to include the target, even though I was adding the framework into the project. I'll look into Cocoa, thanks. AFNetworking has and is now working. iOS 7 was very much a red herring. – roguequery Jun 13 '13 at 05:10
  • 2
    +1 For "red herring" expression and a link to the wikipedia page. Another English sweetie to my collection. :) – akashivskyy Oct 25 '13 at 21:33