Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What are the problem?

M1 MacでXcodeがiOSアプリのアーカイブに失敗する

M1プロセッサのMacで動作するCIツールfastlaneやJenkinsでXcodeを動作させてアプリをビルドしてアーカイブから.ipaファイルをエクスポートしようとしたら何故か "IPA processing failed" のエラーになってしまい悩みまくったので、その解消方法をメモ

しかも何故かxcodebuildを使ってfastlaneのgymやJenkinsが生成するコマンドラインと同じパラメータで手動でxcodeを起動してアプリをビルドするとエラーが出ないので更に悩んでしまった…

fastlaneのgymでアプリをビルドして発生したエラー

2021-02-17 12:34:40.569 xcodebuild[37328:1526046] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/c7/8w5268fs7psdc397k6p8rkz40000gn/T/myshop6_2021-02-17_12-34-40.569.xcdistributionlogs'.
error: exportArchive: IPA processing failed

Error Domain=IDEFoundationErrorDomain Code=1 "IPA processing failed" UserInfo={NSLocalizedDescription=IPA processing failed}

** EXPORT FAILED **
[12:34:41]: Exit status: 70

fastlaneでは gym のオプションに export_options: { compileBitcode: false } を追加する

Fastfile
    gym(
      workspace: "myapp.xcworkspace",
      configuration: "AdHoc",
      scheme: "myapp",
      clean: true,
      include_bitcode: false,
      output_directory: "./build",
      output_name: "myapp.ipa",
      export_method: "ad-hoc",
      xcargs: "-UseModernBuildSystem=NO -destination 'generic/platform=iOS'",
      export_options: { compileBitcode: false }
    )

Jenkinsの場合には exportIpa のオプションに compileBitcode: false を追加する

Jenkinsfile
                exportIpa(
                    xcodeName: "${XCODE_VERSION_NAME}",
                    archiveDir: "${WORKSPACE}/build/Release-iphoneos",
                    manualSigning: true,
                    provisioningProfiles: [
                        [provisioningProfileAppId: "net.hoge2.myapp", provisioningProfileUUID: "AdHoc_myapp.mobileprovision"]
                    ],
                    ipaExportMethod: "ad-hoc",
                    ipaName: "myapp.ipa",
                    ipaOutputDirectory: "AdHoc",
                    compileBitcode: false
                )

まあ、そもそもとして compileBitcode を止めないとアーカイブから.ipaをエクスポート出来ないなんてXcodeのバグだとは思うのですが…

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What are the problem?