Undefined symbol for architecture “_OBJC_CLASS_$_AFHTTPClient”

 ̄綄美尐妖づ 提交于 2019-12-24 01:14:14

问题


Iam using cocoapods with AFNetwork. When I compile the followig error appears:

Undefined symbols for architecture i386:

  "_OBJC_CLASS_$_AFHTTPClient", referenced from:

It happens for the cocoapod classes either with 64 bits or 32. Tried solutions from here:

AFNetworking Library failing in iOS 7

And here:

Undefined symbols for architecture arm64

but they don't work, am I missing something?

I included the project, but do I have to link it in some other way?


回答1:


The problem arises because there is a syntax issue with a deprecation on the source files of JSONKIT, the auto fix apparently prevents the class from being accessed as mentioned here https://stackoverflow.com/a/14191829/2394901. This is in turn is because the pod file specifies:

pod 'AFNetworking', '~> 1.2'

I removed the pod (see How to remove CocoaPods from a project?) and then reinstalled:

$ pod install

With:

pod "AFNetworking", "~> 2.0"


来源:https://stackoverflow.com/questions/23188359/undefined-symbol-for-architecture-objc-class-afhttpclient

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!