AFNetworking报错"_UTTypeCopyPreferredTagWithClass", referenced from: _AFContentTypeForPathExtens
2016-12-21 15:16
453 查看
问题: 在和Unity交互的过程中,从Unity开发工具打包出来的项目文件,在添加AFNetworking库,运行时报出以下错误:
Undefined symbols for architecture armv7:
"_kUTTagClassMIMEType", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o
"_kUTTagClassFilenameExtension", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o
"_UTTypeCopyPreferredTagWithClass", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
原因是未添加 MobileCoreServices.framework(此框架定义统一类型标识符 (UTIs)使用的底层类型)
解决:Build Phase ->Link Binary With Libraries()下添加 MobileCoreServices.framework。添加成功后运行程序成功。
Undefined symbols for architecture armv7:
"_kUTTagClassMIMEType", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o
"_kUTTagClassFilenameExtension", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o
"_UTTypeCopyPreferredTagWithClass", referenced from:
-[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in AFURLRequestSerialization.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
原因是未添加 MobileCoreServices.framework(此框架定义统一类型标识符 (UTIs)使用的底层类型)
解决:Build Phase ->Link Binary With Libraries()下添加 MobileCoreServices.framework。添加成功后运行程序成功。
相关文章推荐
- AFNetworking报错"_UTTypeCopyPreferredTagWithClass", referenced from: _AFContentTypeForPathExtens
- AFNetworking报错"_UTTypeCopyPreferredTagWithClass", referenced from: _AFContentTypeForPathExtens
- ASIHttpRequest "_UTTypeCopyPreferredTagWithClass", referenced from:
- 程序报错:”_SCNetworkReachabilityCreateWithAddress", referenced from:或 "_UTTypeCopyPreferredTagWithClass"
- ASIHttpRequest "_UTTypeCopyPreferredTagWithClass", referenced from:
- iOS--错误集锦--"vtable for __cxxabiv1::__si_class_type_info", referenced from:
- "vtable for __cxxabiv1::__class_type_info", referenced from:
- "vtable for __cxxabiv1::__class_type_info", referenced from:
- The tag handler class for "c:forEach" (org.apache.taglibs.standard.tag.rt.core.ForEachTag) was not found on the Java Build Path
- Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_MAMapServices", referenced from: o
- The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tupli
- Initializing Java Tooling".assertion failed: Path for IClasspathEntry must be absolute
- "_OBJC_CLASS_$_OpenUDID", referenced from:&linker command failed with exit code 1 (use -v to see inv
- The content of element type "session-factory" must match "(property*,mapping*,(class-cache| collect
- Undefined symbols for architecture i386: "_OBJC_CLASS_$_Reachability", referenced from:
- Undefined symbols for architecture i386:"_OBJC_CLASS_$_xx", referenced from: 解决方法
- Defining a Copy Constructor for a Reference Class Type
- LinkageError之loader (instance of xxx) previously initiated loading for a different type with name "lib/MyData"
- 关于[[NSBundle mainBundle] pathForResource:@"name" ofType:@"type"]找不到指定文件的解决办法
- Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error