React Native迁移-仅在CircleCI上,iOS的Fastlane构建失败“存档失败”

时间:2019-09-06 15:00:24

标签: android ios react-native circleci fastlane

正在将移动应用程序从React Native 0.59.0迁移到0.60.5并支持AndroidX。更新后的应用程序在iOS和Android上均可正常运行,并且Android的CircleCI构建正常运行。

在存档期间,使用Fastlane的iOS版CircleCI构建在CircleCI上失败。之前有没有其他人看到并解决过这个问题?

在本地运行bundle exec fastlane ios build_release时,效果很好。

Environment (on CircleCI):
Xcode version: 10.2.1
Fastlane version: 2.130.0
Gym SDK: iphoneos12.2

+----------------------------------------------------+--------------------------------------------------------------+
|                                              Summary for gym 2.130.0                                              |
+----------------------------------------------------+--------------------------------------------------------------+
| scheme                                             | MyApp                                                        |
| export_method                                      | app-store                                                    |
| export_options.provisioningProfiles.com.myapp.app  | match AppStore com.myapp.app                                 |
| workspace                                          | ./MyApp.xcworkspace                                          |
| destination                                        | generic/platform=iOS                                         |
| output_name                                        | MyApp                                                        |
| build_path                                         | /Users/distiller/Library/Developer/Xcode/Archives/2019-09-06 |
| clean                                              | false                                                        |
| output_directory                                   | .                                                            |
| silent                                             | false                                                        |
| skip_package_ipa                                   | false                                                        |
| result_bundle                                      | false                                                        |
| buildlog_path                                      | ~/Library/Logs/gym                                           |
| skip_profile_detection                             | false                                                        |
| xcode_path                                         | /Applications/Xcode-10.2.1.app                               |
+----------------------------------------------------+--------------------------------------------------------------+

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

+---------------+--------------------------------+
|               Build environment                |
+---------------+--------------------------------+
| xcode_path    | /Applications/Xcode-10.2.1.app |
| gym_version   | 2.130.0                        |
| export_method | app-store                      |
| sdk           | iPhoneOS12.2.sdk               |
+---------------+--------------------------------+

[06:24:02]: ▸ Touch /Users/distiller/Library/Developer/Xcode/DerivedData/MyApp-crgfinutbidjbqcbnlrwjwautwhq/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/MyApp.app.dSYM
[06:24:02]: ▸     cd /Users/distiller/mobile-app/ios
[06:24:02]: ▸     export PATH="/Applications/Xcode-10.2.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode-10.2.1.app/Contents/Developer/usr/bin:/Users/distiller/.gem/ruby/2.4.6/bin:/Users/distiller/.rubies/ruby-2.4.6/lib/ruby/gems/2.4.0/bin:/Users/distiller/.rubies/ruby-2.4.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
[06:24:02]: ▸     /usr/bin/touch -c /Users/distiller/Library/Developer/Xcode/DerivedData/MyApp-crgfinutbidjbqcbnlrwjwautwhq/Build/Intermediates.noindex/ArchiveIntermediates/MyApp/BuildProductsPath/Release-iphoneos/MyApp.app.dSYM

2 个答案:

答案 0 :(得分:1)

如错误日志中所述-您使用的是错误的xcode版本,因此快速线无法选择正确的版本;

要定义xcode的版本,应在快速线配置文件中添加

xcversion(version: "10.2")

答案 1 :(得分:1)

我不建议在Fastfile中设置Xcode版本,因为它会一直更改。也许您在本地和CI机器上具有不同的Xcode版本。

我们以前将其设置为Fastfile的顶部:

xcode_select '/Applications/Xcode.app'

确保Xcode位于名称为Xcode的Application文件夹中,然后它应该可以工作...