kumar kumar
kumar kumar

Reputation: 51

Undefined symbols for architecture x86_64 AFNetworking with Cocoapods

Can anybody help me with this, its driving me crazy. I looked at every post I could find with a similar issue, and none of it worked.

I installed AFNetworking 3.0 in my project with Cocoapods, it installed, I see the AFNetworking pod in my project.Set built Architure only :YES Whenever I try to build I get the following error:

Undefined symbols for architecture x86_64:
          "_OBJC_CLASS_$_AFHTTPSessionManager", referenced from:
              objc-class-ref in EFServer.o
          "_OBJC_CLASS_$_AFJSONRequestSerializer", referenced from:
              objc-class-ref in EFServer.o
          "_OBJC_CLASS_$_AFJSONResponseSerializer", referenced from:
              objc-class-ref in EFServer.o
          "_OBJC_CLASS_$_MBProgressHUD", referenced from:
              objc-class-ref in EFServer.o
        ld: symbol(s) not found for architecture x86_64
        clang: error: linker command failed with exit code 1 (use -v to see invocation)

Upvotes: 5

Views: 5826

Answers (3)

kodelit
kodelit

Reputation: 425

I had the same problem after installing pods to my old project. In my case there where custom linker flags added to the Build Settings of the target, but the $(inherited) was removed so the pods flags were missing (not inherited) therefore no AFNetworking framework were linked.

I suggest to check out is there a $(inherited) row added to the Other Linker Flags section of Build Settings for the target.

Upvotes: 8

xi.lin
xi.lin

Reputation: 3414

Just delete the DerivedData folder and re-try.

rm -rf ~/Library/Developer/Xcode/DerivedData

Upvotes: 3

Amit Jagesha シ
Amit Jagesha シ

Reputation: 1112

add below lines to your podfile and reinstall it and add your project name to target.

target 'your project name' do
use_frameworks!
pod 'AFNetworking', '~> 3.0'
end

hope your problem will be solved.

Upvotes: 1

Related Questions