我正试图构建一个ios应用程序,并使用Fastlane将其上传到Testflight,但我遇到了这些错误。appName是我的应用程序的名称。
[04:32:03]: $ set -o pipefail && xcodebuild -workspace ./appName.xcworkspace -scheme appName -destination 'generic/platform=iOS' -archivePath /Users/distiller/Library/Developer/Xcode/Archives/2020-05-01/appName 2020-05-01 04.32.03.xcarchive archive | tee /Users/distiller/Library/Logs/gym/appName-appName.log | xcpretty
[04:32:05]: ▸ ❌ error: /Users/distiller/demo-react-native/ios/Pods/Target Support Files/Pods-appName/Pods-appName.release.xcconfig: unable to open file (in target "appName" in project "appName") (in target 'appName')
[04:32:05]: ▸ ❌ error: /Users/distiller/demo-react-native/ios/Pods/Target Support Files/Pods-appName/Pods-appName.release.xcconfig: unable to open file (in target "appName" in project "appName") (in target 'appName')
[04:32:05]: ▸ ❌ error: /Users/distiller/demo-react-native/ios/Pods/Target Support Files/Pods-appName/Pods-appName.release.xcconfig: unable to open file (in target "appName" in project "appName") (in target 'appName')
[04:32:05]: ▸ ❌ error: Failed to parse IPHONEOS_DEPLOYMENT_TARGET: Could not parse version component from: '3 ' (in target 'appName')
[04:32:05]: ▸ ** ARCHIVE FAILED **
❌ error: /Users/distiller/demo-react-native/ios/Pods/Target Support Files/Pods-appName/Pods-appName.release.xcconfig: unable to open file (in target "appName" in project "appName") (in target 'appName')
❌ error: /Users/distiller/demo-react-native/ios/Pods/Target Support Files/Pods-appName/Pods-appName.release.xcconfig: unable to open file (in target "appName" in project "appName") (in target 'appName')
❌ error: /Users/distiller/demo-react-native/ios/Pods/Target Support Files/Pods-appName/Pods-appName.release.xcconfig: unable to open file (in target "appName" in project "appName") (in target 'appName')
❌ error: Failed to parse IPHONEOS_DEPLOYMENT_TARGET: Could not parse version component from: '3 ' (in target 'appName')
** ARCHIVE FAILED **
[04:32:05]: Exit status: 65
[04:32:05]:
[04:32:05]: Maybe the error shown is caused by using the wrong version of Xcode
[04:32:05]: Found multiple versions of Xcode in '/Applications/'
[04:32:05]: Make sure you selected the right version for your project
[04:32:05]: This build process was executed using '/Applications/Xcode-10.1.app'
[04:32:05]: If you want to update your Xcode path, either
[04:32:05]:
[04:32:05]: - Specify the Xcode version in your Fastfile
[04:32:05]: ▸ xcversion(version: "8.1") # Selects Xcode 8.1.0
[04:32:05]:
[04:32:05]: - Specify an absolute path to your Xcode installation in your Fastfile
[04:32:05]: ▸ xcode_select "/Applications/Xcode8.app"
[04:32:05]:
[04:32:05]: - Manually update the path using
[04:32:05]: ▸ sudo xcode-select -s /Applications/Xcode.app
[04:32:05]:
+---------------+------------------------------+
| Build environment |
+---------------+------------------------------+
| xcode_path | /Applications/Xcode-10.1.app |
| gym_version | 2.146.1 |
| export_method | app-store |
| sdk | iPhoneOS12.1.sdk |
+---------------+------------------------------+
[04:32:05]: ▸ Build system information
[04:32:05]: ▸ error: /Users/distiller/demo-react-native/ios/Pods/Target Support Files/Pods-appName/Pods-appName.release.xcconfig: unable to open file (in target "appName" in project "appName") (in target 'appName')
[04:32:05]: ▸ Build system information
[04:32:05]: ▸ error: Failed to parse IPHONEOS_DEPLOYMENT_TARGET: Could not parse version component from: '3 ' (in target 'appName')
[04:32:05]:
[04:32:05]: ⬆️ Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[04:32:05]: 📋 For the complete and more detailed error log, check the full log at:
[04:32:05]: 📋 /Users/distiller/Library/Logs/gym/appName-appName.log
[04:32:05]:
[04:32:05]: Looks like fastlane ran into a build/archive error with your project
[04:32:05]: It's hard to tell what's causing the error, so we wrote some guides on how
[04:32:05]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[04:32:05]: Before submitting an issue on GitHub, please follow the guide above and make
[04:32:05]: sure your project is set up correctly.
[04:32:05]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[04:32:05]: the full commands printed out in yellow in the above log.
[04:32:05]: Make sure to inspect the output above, as usually you'll find more error information there
这可能是因为pod install
对您来说失败了,或者在安装依赖项时出现了其他问题。
我今天花了一整天的时间在这上面,结果我的同事指出我的pod install
命令在构建的早期失败了。
18:40:00 + cd app/ios
18:40:00 + pod install --repo-update
18:40:00 ./install.sh: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
18:40:00 + cd ../../
看到这里,很明显这是我的Ruby环境的一个问题。我已经在系统中更新了ruby(到2.6.3(,在这些日志中仍然可以看到对旧版本(2.3(的引用。