fastlane: Export fails for enterprise with Xcode8

New Issue Checklist

Issue Description

When I use Xcode8 and the following gym for exporting by enterprise, it is failed with message “Exit status: 12” and “Error packaging up the application”.

gym(
  workspace: "xxx.xcworkspace",
  configuration: configuration,
  scheme: scheme,
  silent: true,
  clean: true,
  output_directory: output_directory,
  output_name: output_name,
  codesigning_identity: "xxx",
  export_team_id: "xxx",
  export_method: "enterprise",
  toolchain: "com.apple.dt.toolchain.Swift_2_3",
  use_legacy_build_api: true,
  include_bitcode: false,
)
end
Complete output when running fastlane, including the stack trace and command used
[09:46:24]: -------------------------------------------------
[09:46:24]: --- Step: Verifying required fastlane version ---
[09:46:24]: -------------------------------------------------
[09:46:24]: fastlane version valid
[09:46:24]: ------------------------------
[09:46:24]: --- Step: default_platform ---
[09:46:24]: ------------------------------
[09:46:25]: Driving the lane 'ios ipa_inhouse' 🚀
[09:46:25]: ------------------
[09:46:25]: --- Step: sigh ---
[09:46:25]: ------------------

+-------------------------------------+---------------------------------------+
|                           Summary for sigh 1.11.1                           |
+-------------------------------------+---------------------------------------+
| adhoc                               | false                                 |
| development                         | false                                 |
| skip_install                        | false                                 |
| force                               | false                                 |
| app_identifier                      | xxx                                   |
| username                            | xxx                                   |
| team_id                             | xxx                                   |
| ignore_profiles_with_different_name | false                                 |
| skip_fetch_profiles                 | false                                 |
| skip_certificate_verification       | false                                 |
+-------------------------------------+---------------------------------------+

[09:46:25]: Starting login with user 'xxx'
[09:46:29]: Successfully logged in
[09:46:29]: Fetching profiles...
[09:46:36]: Found 2 matching profile(s)
[09:46:36]: Downloading provisioning profile...
[09:46:37]: Successfully downloaded provisioning profile...
[09:46:37]: Installing provisioning profile...
xxx
[09:46:37]: Setting Provisioning Profile type to 'enterprise'
[09:46:37]: --------------------------------------------------
[09:46:37]: --- Step: Switch to ios update_enterprise lane ---
[09:46:37]: --------------------------------------------------
[09:46:37]: Cruising over to lane 'ios update_enterprise' 🚖
[09:46:37]: -------------------------------
[09:46:37]: --- Step: update_info_plist ---
[09:46:37]: -------------------------------
[09:46:37]: Updated xxx/Application/Info.plist 💾.
[09:46:37]: ---------------------------------
[09:46:37]: --- Step: update_project_team ---
[09:46:37]: ---------------------------------
[09:46:37]: Updating development team (xxx) for the given project 'xxx.xcodeproj/project.pbxproj'
[09:46:37]: Successfully updated project settings to use Developer Team ID 'xxx'
[09:46:37]: -----------------------------------
[09:46:37]: --- Step: update_app_identifier ---
[09:46:37]: -----------------------------------
[09:46:41]: Updated xxx.xcodeproj 💾.
[09:46:41]: Cruising back to lane 'ios ipa_inhouse' 🚘
[09:46:41]: -------------------------------------------------
[09:46:41]: --- Step: Switch to ios build_enterprise lane ---
[09:46:41]: -------------------------------------------------
[09:46:41]: Cruising over to lane 'ios build_enterprise' 🚖
[09:46:41]: ------------------------------------
[09:46:41]: --- Step: increment_build_number ---
[09:46:41]: ------------------------------------
[09:46:41]: $ cd xxx && agvtool new-version -all 0.1.0 && cd -
[09:46:41]: Setting version of project xxx to:
[09:46:41]: 0.1.0.
[09:46:41]: Also setting CFBundleVersion key (assuming it exists)
[09:46:41]: Updating CFBundleVersion in Info.plist(s)...
[09:46:41]: Updated CFBundleVersion in "xxx/Info.plist" to 0.1.0
[09:46:41]: Updated CFBundleVersion in "xxx/Info.plist" to 0.1.0
[09:46:41]: xxx
[09:46:41]: -----------------
[09:46:41]: --- Step: gym ---
[09:46:41]: -----------------
[09:46:41]: Using legacy build system - waiting for radar to be fixed: https://openradar.appspot.com/radar?id=xxx
[09:46:41]: Installing provisioning profile...
[09:46:41]: $ xcodebuild -list -workspace xxx.xcworkspace
[09:46:43]: $ xcodebuild clean -showBuildSettings -workspace xxx.xcworkspace -scheme xxx

+---------------------------+----------------------------------------------------------------------+
|                                      Summary for gym 1.10.0                                      |
+---------------------------+----------------------------------------------------------------------+
| workspace                 | xxx.xcworkspace                                                      |
| configuration             | Debug                                                                |
| scheme                    | xxx                                                                  |
| silent                    | true                                                                 |
| clean                     | true                                                                 |
| output_directory          | build                                                                |
| output_name               | xxx                                                                  |
| codesigning_identity      | iPhone Distribution: xxx                                             |
| export_method             | enterprise                                                           |
| toolchain                 | com.apple.dt.toolchain.Swift_2_3                                     |
| use_legacy_build_api      | true                                                                 |
| include_bitcode           | false                                                                |
| provisioning_profile_path | /Users/xxx/....                                                      |
| destination               | generic/platform=iOS                                                 |
| buildlog_path             | ~/Library/Logs/gym                                                   |
+---------------------------+----------------------------------------------------------------------+

[09:46:47]: Cleaning
[09:46:47]: Check Dependencies
...
[09:49:14]: Copying IconAssets2.framework
[09:49:16]: Running script 'Embed Pods Frameworks'
[09:49:16]: Running script 'Copy Pods Resources'
[09:49:16]: Running script 'Strip Unsupported Architectures'
[09:49:17]: Running script 'Run Script'
[09:49:17]: Touching xxx.app
[09:49:19]: Signing xxx.app
[09:49:22]: Archive Succeeded
[09:49:22]: Legacy build api is enabled, the `export_method` value will be ignored

[09:49:39]: Exit status: 12
[09:49:39]: Variable Dump:
[09:49:39]: {:DEFAULT_PLATFORM=>:ios, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios ipa_inhouse", :SIGH_PROFILE_PATH=>"xxx.mobileprovision", :SIGH_PROFILE_PATHS=>["xxx.mobileprovision"], :SIGH_UDID=>"xxx", :SIGH_PROFILE_TYPE=>"enterprise", :BUILD_NUMBER=>"0.1.0"}
[09:49:39]: Error packaging up the application

+------+--------------------------------------+-------------+
|                     fastlane summary                      |
+------+--------------------------------------+-------------+
| Step | Action                               | Time (in s) |
+------+--------------------------------------+-------------+
| 1    | Verifying required fastlane version  | 0           |
| 2    | default_platform                     | 0           |
| 3    | sigh                                 | 12          |
| 4    | Switch to ios update_enterprise lane | 0           |
| 5    | update_info_plist                    | 0           |
| 6    | update_project_team                  | 0           |
| 7    | update_app_identifier                | 3           |
| 8    | Switch to ios build_enterprise lane  | 0           |
| 9    | increment_build_number               | 0           |
| 10   | gym                                  | 178         |
+------+--------------------------------------+-------------+

[09:49:39]: fastlane finished with errors

[!] Error packaging up the application

Configuration Files

Please copy the complete content of your Fastfile and any other configuration files you use below:

Fastfile:

fastlane_version "1.104.0"

default_platform :ios

CONFIGURATION_DEBUG   = "Debug"
CONFIGURATION_RELEASE     = "Release"

platform :ios do
  #====================== Public =================#
  lane :ipa_inhouse do |options|
    version = options[:version]
    config = options[:config] || CONFIGURATION_DEBUG
    config_name = config == CONFIGURATION_DEBUG ? "debug" : "release"
    disp_config = config == CONFIGURATION_DEBUG ? "D" : "R"
    disp_name = options[:disp_name] || "xxx" + version + disp_config

    sigh()

    update_enterprise(
      display_name: disp_name,
    )

    build_enterprise(
      version: version,
      scheme: "xxx",
      output_directory: "build",
      output_name: "xxx_" + config_name + "_inhouse.ipa",
      configuration: config,
    )
  end

  #===================== Private =================#
  private_lane :build_enterprise do |options|
    version          = options[:version]
    scheme           = options[:scheme]
    output_directory = options[:output_directory]
    output_name      = options[:output_name]
    configuration    = options[:configuration]
    production       = options[:production]

    if version
      increment_build_number(
        build_number: version,
        xcodeproj: "xxx.xcodeproj"
      )
    end

    ENV["FASTLANE_XCODE_LIST_TIMEOUT"] = "120"

    gym(
      workspace: "xxx.xcworkspace",
      configuration: configuration,
      scheme: scheme,
      silent: true,
      clean: true,
      output_directory: output_directory,
      output_name: output_name,
      codesigning_identity: "xxx",
      export_team_id: "xxx",
      export_method: "enterprise",
      toolchain: "com.apple.dt.toolchain.Swift_2_3",
      use_legacy_build_api: true,
      include_bitcode: false,
    )
  end

  private_lane :update_enterprise do |options|
    # Update Display Name
    display_name  = options[:display_name]
    update_info_plist(
      plist_path: "xxx/Application/Info.plist",
      display_name: display_name
    )

    # Update Team
    update_project_team(
      path: "xxx.xcodeproj",
      teamid: "xxx"
    )

    # Update BundleIdentifier
    update_app_identifier(
      plist_path: "xxx/Application/Info.plist",
      app_identifier: "xxx"
    )
  end

  error do |lane, exception|
  end
end

Environment

fastlane version (run fastlane -v): 1.104.0

Do you use bundler to execute fastlane (i.e. bundle exec fastlane)? yes

Do you use a Ruby environment manager (e.g. chruby, rbenv, rvm)? no

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 27 (5 by maintainers)

Most upvoted comments

We are having the same issue. For us, the issue only appears when using update_app_identifier before gym. If I comment out update_app_identifier, no errors.

update_app_identifier(app_identifier: ENV[‘APPID’], plist_path: “Info.plist”) gym(scheme: “Scheme Name”, output_name: ENV[‘APPNAME’], use_legacy_build_api:true)

I have confirmed with puts commands that both environment variables exist and that they output the correct data. This issue only exists with Xcode 8 not Xcode 7.

Exit status: 12 Variable dump: {:DEFAULT_PLATFORM=>:ios, :ENVIRONMENT=>“envName”, :PLATFORM_NAME=>:ios, :LANE_NAME=>“ios build_app”} Error packaging up the application

@hachibe Thanks so much for answering those questions. I followed up with the team here so we can look into it. We’ll work with you on this thread.