AFNetworking-2与Trigger.io

时间:2014-05-01 16:37:07

标签: trigger.io afnetworking-2

我正在构建一个trigger.io本机模块,并通过手动将标头和实现文件添加到ForgeModule项目中来包含AFNetworking 2.0框架。

AFNetworking 2.0 indicates ios 6.0 +的目标要求。

在xcode中,我已将UniversalForgeModule的部署目标更改为6.0

然而,在我的应用程序中包含这个新打包的本机模块之后,构建它时出现以下错误:

Ld build/Release-iphonesimulator/ForgeInspector.app/Forge normal i386
    cd /var/folders/xw/34h86n3d5p54qpq1wfc8ff600000b1/T/tmp5z_JZJ/ios/app
    setenv IPHONEOS_DEPLOYMENT_TARGET 5.0.1

...

   Undefined symbols for architecture i386:
  _UTTypeCopyPreferredTagWithClass", referenced from:
      -[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
  "_UTTypeCreatePreferredIdentifierForTag", referenced from:
      -[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
  "_kUTTagClassFilenameExtension", referenced from:
      -[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
  "_kUTTagClassMIMEType", referenced from:
      -[AFStreamingMultipartFormData appendPartWithFileURL:name:error:] in frisbees.a(AFURLRequestSerialization.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
  Ld build/Release-iphonesimulator/ForgeInspector.app/Forge normal i386
(1 failure)

看起来我的构建目标仍为5.0.1。我该如何改变呢?

可用的完整日志here

谢谢!

1 个答案:

答案 0 :(得分:2)

AFNetworking 2.0似乎引用了Apple Framework:MobileCoreServices.framework。

要将Apple框架包含到您的模块中,您需要Change build configuration添加add_ios_system_framework构建步骤。

步骤:

  1. build_steps.json文件添加到模块目录中的ios文件夹中。
  2. 将以下内容添加到文件中:

    [ 
      {
        "do": {
          "add_ios_system_framework": {
              "framework": "MobileCoreServices.framework"
           }
         }
      }
    ]
    
  3. 更新您的检查器项目,以便将新添加的构建步骤应用于您的项目。