3

为什么我需要在使用健身房构建项目时添加 use_legacy_build_api: true ?

我使用了 Xcode 7.3 和健身房 1.6.2,

我建立了一个新项目(OC 或 swift 相同),

下面是错误输出:

2016-04-22 18:45:46.071 xcodebuild[135:10371572] [MT] PluginLoading: Required plug-in compatibility UUID F41BD31E-2683-44B8-AE7F-5F09E919790E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/BBUFullIssueNavigator.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2016-04-22 18:45:46.246 xcodebuild[135:10371572] ### Failed to load Addressbook class CNContactNameFormatter
2016-04-22 18:45:46.300 xcodebuild[135:10371572] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/4w/fpkx9n7s3gnbcxfym8mqr18m0000gn/T/GymDemo_2016-04-22_18-45-46.299.xcdistributionlogs'.
2016-04-22 18:45:46.585 xcodebuild[135:10371572] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7ff847a3e450>: Error Domain=IDEDistributionErrorDomain Code=1 "(null)"
error: exportArchive: The operation couldn’t be completed. (IDEDistributionErrorDomain error 1.)

Error Domain=IDEDistributionErrorDomain Code=1 "(null)"

** EXPORT FAILED **
[18:45:46]: Exit status: 70

[!] Error packaging up the application
4

2 回答 2

0

我不知道为什么会出错,但是我只是使用fastlane init并更改了fastlane,一切正常。这是我的快速文件:</p>

desc "Deploy a new version to the App Store"
  lane :appstore do
    # match(type: "appstore")
    # snapshot
    #sigh
    gym(
      scheme: "myscheme_iOS",
      export_method:"app-store",
      output_directory:"./fastlane",
      output_name:"myipa_20160607030055",
      codesigning_identity:"iPhone Distribution: Jack Zhou (9R46C82WH7)"
    ) # Build your app - more options available
    #deliver(force: true)
    # frameit
  end
于 2016-06-07T07:11:47.533 回答
0

use_legacy_build_api仅当您使用 Xcode 6 或更早版本运行时才应使用该标志。

正如Felix KrauseGithub上解释的那样:

什么是 use_legacy_build_api
它使用的是 Xcode 6 构建 API,官方不再支持该 API。

发生的事情是,在 Xcode 6 和 7 之间,对构建/打包过程进行了几处更改,因此为了适应新过程并仍然能够与旧版本一起工作,fastlane 引入了这个新标志,基本上告知哪个命令要执行利用。

Xcode 7

由于您使用的是 Xcode 7,因此您需要指定导出应用程序的方式,这与您在使用 Xcode 本身时需要做出的选择相同: 使用 Xcode 导出存档

您还可以在 Apple 文档Exporting Your App上阅读有关导出方法的更多信息

健身房

因此,正如上面使用 Fastlane 所解释的,您应该export_method相应地指定该字段:

gym(export_method:"app-store|ad-hoc|package|enterprise|development|developer-id")

您可以在fastlane 操作文档中阅读有关 Gym 及其参数的更多信息

  • use_legacy_build_api:[已弃用!] 不要再使用此选项,因为它已被 Apple 弃用 - 不要再使用此选项,因为它已被 Apple 弃用
  • export_method:用于导出存档的方法。有效值为:app-store、ad-hoc、package、enterprise、development、developer-id
于 2017-02-08T13:44:30.507 回答