簡體   English   中英

xcodebuild 存檔在 CircleCI 上失敗,退出狀態為 65

[英]xcodebuild archive fails with exit status 65 on CircleCI

大綱

你好! 我正在嘗試通過將 fastlane 與匹配和健身房結合使用來自動化臨時構建。 我可以在本地環境中存檔。 但我無法在 Circle CI 存檔。 看起來 xcodebuild 命令失敗了。 我通過 ssh 登錄作業,此命令在 Circle CI 失敗。

$ xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Release -destination 'generic/platform=iOS' -archivePath MyApp.xcarchive clean archive | 三通/Users/distiller/Library/Logs/gym/MyApp-MyApp.log

請告訴我解決方案。

我做了什么

https://circleci.com/docs/2.0/ios-codesigning/

我已經通過參考此頁面設置了項目設置。

我的代碼符號 settig 在這里。

https://circleci-discourse.s3.amazonaws.com/original/2X/6/6e3c5cf2ed04b16a3d782d99c99107d5889a29f8.png

快車道來了。

version: 2
jobs:
 setup:
   macos:
     xcode: "9.2.0"
   shell: /bin/bash --login -eo pipefail
   steps:
     - checkout
     - run:
         name: Set Ruby Version
         command:  echo "ruby-2.4" > ~/.ruby-version
     - restore_cache:
         keys:
           - gems-{{ checksum "Gemfile.lock" }}
     - run:
         name: Running bundle install
         command: bundle check || bundle install --path vendor/bundle
         environment:
             - BUNDLE_JOBS: 4
             - BUNDLE_RETRY: 3
     - save_cache:
         key: gems-{{ checksum "Gemfile.lock" }}
         paths:
           - vendor/bundle
     - restore_cache:
         keys:
           - pods--{{ checksum "Podfile.lock" }}
     - run:
         name: Running pod install
         command: |
           curl https://cocoapods-specs.circleci.com/fetch-cocoapods-repo-from-s3.sh | bash -s cf
           bundle exec pod install
     - save_cache:
         key: pods-{{ checksum "Podfile.lock" }}
         paths:
           - Pods
           - MyApp.xcworkspace
 beta-deployment:
   macos:
     xcode: "9.2.0"
   shell: /bin/bash --login -eo pipefail
   steps:
     - checkout
     - restore_cache:
         keys:
           - gems-{{ checksum "Gemfile.lock" }}
     - restore_cache:
         keys:
           - pods-{{ checksum "Podfile.lock" }}
     - run: echo "ruby-2.4" > ~/.ruby-version
     - run: bundle install
     - run: bundle exec fastlane build_adhoc
     - store_artifacts:
         path: MyApp.app.dSYM.zip
     - store_artifacts:
         path: MyApp.ipa
workflows:
  version: 2
  build_test_deployment:
    jobs:
      - setup
      - beta-deployment:
          requires:
            - setup

config.yml 在這里。

fastlane_version "2.35.1"

default_platform :ios

platform :ios do
  lane :build_adhoc do
    setup_circle_ci
    match(type: "appstore", app_identifier: "jp.hogehoge.MyApp", readonly: true)
    match(type: "adhoc", app_identifier: "jp.hogehoge.MyApp", readonly: true)
    gym(
      scheme: "MyApp",
      workspace: "MyApp.xcworkspace",
      configuration: "Release",
      export_method: "ad-hoc",
      export_options: {
        provisioningProfiles: {
        "jp.hogehoge.MyApp" => "match AdHoc jp.hogehoge.MyApp"
        }
      },
      clean: true
    )
  end
end

失敗的日志在這里。

...
...
▸ Running script '[CP] Embed Pods Frameworks'
▸ Running script '[CP] Copy Pods Resources'
▸ Touching MyApp.app
▸ Signing /Users/distiller/Library/Developer/Xcode/DerivedData/MyApp-dsgauupkymppmmgymocmzptqnqrr/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
▸ Touching MyApp.app.dSYM
** ARCHIVE FAILED **
[01:51:08]: Exit status: 65
[01:51:08]: 
[01:51:08]: Maybe the error shown is caused by using the wrong version of Xcode
[01:51:08]: Found multiple versions of Xcode in '/Applications/'
[01:51:08]: Make sure you selected the right version for your project
[01:51:08]: This build process was executed using '/Applications/Xcode-9.2.app'
[01:51:08]: If you want to update your Xcode path, either
[01:51:08]: 
[01:51:08]: - Specify the Xcode version in your Fastfile
[01:51:08]: ▸ xcversion(version: "8.1") # Selects Xcode 8.1.0
[01:51:08]: 
[01:51:08]: - Specify an absolute path to your Xcode installation in your Fastfile
[01:51:08]: ▸ xcode_select "/Applications/Xcode8.app"
[01:51:08]: 
[01:51:08]: - Manually update the path using
[01:51:08]: ▸ sudo xcode-select -s /Applications/Xcode.app
[01:51:08]: 

+---------------+-----------------------------+
|              Build environment              |
+---------------+-----------------------------+
| xcode_path    | /Applications/Xcode-9.2.app |
| gym_version   | 2.79.0                      |
| export_method | ad-hoc                      |
| sdk           | iPhoneOS11.2.sdk            |
+---------------+-----------------------------+

[01:51:08]: ▸ Touch /Users/distiller/Library/Developer/Xcode/DerivedData/MyApp-dsgauupkymppmmgymocmzptqnqrr/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/MyApp.app.dSYM
[01:51:08]: ▸     cd /Users/distiller/project
[01:51:08]: ▸     export PATH="/Applications/Xcode-9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-9.2.app/Contents/Developer/usr/bin:/Users/distiller/.gem/ruby/2.4.2/bin:/Users/distiller/.rubies/ruby-2.4.2/lib/ruby/gems/2.4.0/bin:/Users/distiller/.rubies/ruby-2.4.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
[01:51:08]: ▸     /usr/bin/touch -c /Users/distiller/Library/Developer/Xcode/DerivedData/MyApp-dsgauupkymppmmgymocmzptqnqrr/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/MyApp.app.dSYM
[01:51:08]: 
[01:51:08]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[01:51:08]: 📋  For the complete and more detailed error log, check the full log at:
[01:51:08]: 📋  /Users/distiller/Library/Logs/gym/MyApp-MyApp.log
[01:51:08]: 
[01:51:08]: Looks like fastlane ran into a build/archive error with your project
[01:51:08]: It's hard to tell what's causing the error, so we wrote some guides on how
[01:51:08]: to troubleshoot build and signing issues: docs.fastlane.tools/codesigning/getting-started/
[01:51:08]: Before submitting an issue on GitHub, please follow the guide above and make
[01:51:08]: sure your project is set up correctly.
[01:51:08]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[01:51:08]: the full commands printed out in yellow in the above log.
[01:51:08]: Make sure to inspect the output above, as usually you'll find more error information there
[01:51:08]: 
+------------------------------------+--------------------------------------------------------------------------------+
|                                                    Lane Context                                                     |
+------------------------------------+--------------------------------------------------------------------------------+
| DEFAULT_PLATFORM                   | ios                                                                            |
| PLATFORM_NAME                      | ios                                                                            |
| LANE_NAME                          | ios build_adhoc                                                                |
| ORIGINAL_DEFAULT_KEYCHAIN          | "/Users/distiller/Library/Keychains/login.keychain-db"                         |
| SIGH_PROFILE_TYPE                  | ad-hoc                                                                         |
| MATCH_PROVISIONING_PROFILE_MAPPING | {"jp.hogehoge.MyApp"=>"match AdHoc jp.hogehoge.MyApp"} |
+------------------------------------+--------------------------------------------------------------------------------+
[01:51:08]: Error building the application - see the log above

+------+---------------------------------+-------------+
|                   fastlane summary                   |
+------+---------------------------------+-------------+
| Step | Action                          | Time (in s) |
+------+---------------------------------+-------------+
| 1    | Verifying fastlane version      | 0           |
| 2    | default_platform                | 0           |
| 3    | setup_circle_ci                 | 0           |
| 4    | Switch to ios certificates lane | 0           |
| 5    | match                           | 2           |
| 6    | match                           | 2           |
| 7    | match                           | 1           |
| 💥   | gym                             | 207         |
+------+---------------------------------+-------------+

[01:51:08]: fastlane finished with errors

[!] Error building the application - see the log above

...

[23:25:14]: WARNING: fastlane requires your locale to be set to UTF-8. To learn more go ://docs.fastlane.tools/getting-started/ios/setup/#set-up-environment-variables
Exited with code 1

我看到了同樣的問題,但原因完全不同。

我錯誤地添加了一個帶有過時路徑的文件導入。 由於這個問題,我無法在本地啟動該應用程序。

一旦我修復了源代碼的問題,應用程序就可以正常啟動並且工作按預期工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM