AFNetworking报错"_UTTypeCopyPreferredTagWithClass", referenced from: _AFContentTypeForPathExtens
2017-10-25 15:26
507 查看
问题:
最近在原来项目中用MKNetworkKit 实现网络请求,想为了使应用符合AppStore的要求,用AFNetworking3.0+来满足ipv6。导入AFNetworking 和UIKit+AFNetworking 两个文件的时候5处地方报错
:
Undefined symbols for architecture x86_64:
"_UTTypeCopyPreferredTagWithClass", referenced from:
_AFContentTypeForPathExtension in AFURLRequestSerialization.o
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
_AFContentTypeForPathExtension in AFURLRequestSerialization.o
"_kUTTagClassFilenameExtension", referenced from:
_AFContentTypeForPathExtension in AFURLRequestSerialization.o
"_kUTTagClassMIMEType", referenced from:
_AFContentTypeForPathExtension in AFURLRequestSerialization.o
ld: symbol(s) not found for architecture x86_64
知道是确少.framework 框架。就不知道是哪个.framework。最后找到是未添加 MobileCoreServices.framework(此框架定义统一类型标识符
(UTIs)使用的底层类型)
解决:Build Phase ->Link Binary With Libraries()下添加 MobileCoreServices.framework。添加成功后运行程序成功。
如果在新建的工程中直接导入AFNetworking
和UIKit+AFNetworking 文件夹是不会报错,即使最低支持版本7.0,Bitcode值为NO,不添加 MobileCoreServices.framework 都不会报错。这和工程的配置有关。
最近在原来项目中用MKNetworkKit 实现网络请求,想为了使应用符合AppStore的要求,用AFNetworking3.0+来满足ipv6。导入AFNetworking 和UIKit+AFNetworking 两个文件的时候5处地方报错
:
Undefined symbols for architecture x86_64:
"_UTTypeCopyPreferredTagWithClass", referenced from:
_AFContentTypeForPathExtension in AFURLRequestSerialization.o
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
_AFContentTypeForPathExtension in AFURLRequestSerialization.o
"_kUTTagClassFilenameExtension", referenced from:
_AFContentTypeForPathExtension in AFURLRequestSerialization.o
"_kUTTagClassMIMEType", referenced from:
_AFContentTypeForPathExtension in AFURLRequestSerialization.o
ld: symbol(s) not found for architecture x86_64
知道是确少.framework 框架。就不知道是哪个.framework。最后找到是未添加 MobileCoreServices.framework(此框架定义统一类型标识符
(UTIs)使用的底层类型)
解决:Build Phase ->Link Binary With Libraries()下添加 MobileCoreServices.framework。添加成功后运行程序成功。
如果在新建的工程中直接导入AFNetworking
和UIKit+AFNetworking 文件夹是不会报错,即使最低支持版本7.0,Bitcode值为NO,不添加 MobileCoreServices.framework 都不会报错。这和工程的配置有关。
相关文章推荐
- AFNetworking报错"_UTTypeCopyPreferredTagWithClass", referenced from: _AFContentTypeForPathExtens
- AFNetworking报错"_UTTypeCopyPreferredTagWithClass", referenced from: _AFContentTypeForPathExtens
- ASIHttpRequest "_UTTypeCopyPreferredTagWithClass", referenced from:
- 程序报错:”_SCNetworkReachabilityCreateWithAddress", referenced from:或 "_UTTypeCopyPreferredTagWithClass"
- ASIHttpRequest "_UTTypeCopyPreferredTagWithClass", referenced from:
- "vtable for __cxxabiv1::__class_type_info", referenced from:
- "vtable for __cxxabiv1::__class_type_info", referenced from:
- iOS--错误集锦--"vtable for __cxxabiv1::__si_class_type_info", referenced from:
- Undefined symbols for architecture i386:和"_OBJC_CLASS_$_xx", referenced from:问题解决方法
- Undefined symbols for architecture i386和”_OBJC_CLASS_$_xx文件名", referenced from:
- previously initiated loading for a different type with name "javax/servlet/ServletContext"
- "org.xml.sax.SAXParseException: The content of element type "class" must match" 异常解决
- "_OBJC_CLASS_$_WKWebView", referenced from:"...and "linker command failed with exit code 1 (use -v "
- [[NSBundle mainBundle]pathForResource:@"name" ofType:@"type"] 获取不到本地文件
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_WKWebView", referenced from: objc-
- "cvc-complex-type.2.4.a: Invalid content was found starting with element ..."的解决方法
- iOS [[NSBundle mainBundle] pathForResource:@"" ofType:@""]无法获取到文件
- Json转对象失败:"No suitable constructor found for type [simple type, class com.test.faster.domain.respons
- Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error
- "typeinfo for XXX::xxx", referenced from:typeinfo for xxx::xxx > in xx.o