Fastlane 在上传到 TestFlight 时失败

Fastlane failed while uploading to TestFlight

我有一个简单的 fastlane 命令,如下所示。

  desc "Push a new beta build to TestFlight"
  lane :beta do
    build_app(workspace: "Project.xcworkspace", scheme: "Project")
    upload_to_testflight
  end

归档成功。但是在上传过程中崩溃,日志如下:

[11:24:38]: ▸ ** ARCHIVE SUCCEEDED **
[11:24:38]: 
[11:24:38]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[11:24:38]:   For the complete and more detailed error log, check the full log at:
[11:24:38]:   /Users/user/Library/Logs/gym/project.log
[11:24:38]: 
[11:24:38]: Looks like fastlane ran into a build/archive error with your project
[11:24:38]: It's hard to tell what's causing the error, so we wrote some guides on how
[11:24:38]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[11:24:38]: Before submitting an issue on GitHub, please follow the guide above and make
[11:24:38]: sure your project is set up correctly.
[11:24:38]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[11:24:38]: the full commands printed out in yellow in the above log.
[11:24:38]: Make sure to inspect the output above, as usually you'll find more error information there
[11:24:38]: 
[11:24:38]: Looks like no provisioning profile mapping was provided
[11:24:38]: Please check the complete output, in particular the very top
[11:24:38]: and see if you can find more information. You can also run fastlane
[11:24:38]: with the `--verbose` flag.
[11:24:38]: Alternatively you can provide the provisioning profile mapping manually
[11:24:38]: https://docs.fastlane.tools/codesigning/xcode-project/#xcode-9-and-up
+------------------+-----------+
|         Lane Context         |
+------------------+-----------+
| DEFAULT_PLATFORM | ios       |
| PLATFORM_NAME    | ios       |
| LANE_NAME        | ios tests |
| BUILD_NUMBER     | 4         |
+------------------+-----------+
[11:24:38]: Error packaging up the application

+------+------------------------+-------------+
|              fastlane summary               |
+------+------------------------+-------------+
| Step | Action                 | Time (in s) |
+------+------------------------+-------------+
| 1    | default_platform       | 0           |
| 2    | increment_build_number | 2           |
|    | build_app              | 742         |
+------+------------------------+-------------+

[11:24:38]: fastlane finished with errors

[!] Error packaging up the application

我发现当我尝试手动上传应用程序时,Xcode 抛出了与权限相关的异常。我当前的配置文件具有 developer 角色,验证和上传到 TestFlight 需要 admin 角色。我更改了配置文件,Fastlane 已成功完成。