Xcodebuild Archive 因错误 PhaseScriptExecution Jenkins 失败

Dro*_*rap 5 build ios jenkins jenkins-pipeline cicd

我正在尝试从 jenkins 创建 iOS 存档。虽然 Build PC 的 Build 命令工作正常,但当我从 jenkins 运行相同的命令时,我遇到了这个问题。这是一个 React Native 项目

命令:

sh 'xcrun xcodebuild archive -workspace AppName.xcworkspace -scheme Test -sdk iphoneos -configuration release -allowProvisioningUpdates -destination "generic/platform=iOS" arch=x86_64  -archivePath "/Users/ali/Desktop/Test_bulds"'
Run Code Online (Sandbox Code Playgroud)

错误:

    /Users/ali/jenkins/workspace/Mobile/MobileAppBuild/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.2.99. (in target 'react-native-blur' from project 'Pods')
** ARCHIVE FAILED **


The following build commands failed:
    PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks /Users/ali/Library/Developer/Xcode/DerivedData/Appname-hamnkyelypjutaefdzwfxmvlwith/Build/Intermediates.noindex/ArchiveIntermediates/Test/IntermediateBuildFilesPath/Appname.build/Release-iphoneos/Appname.build/Script-CF1348D5D60844C3DD63C481.sh (in target 'AppName' from project 'AppNAme')
Run Code Online (Sandbox Code Playgroud)

Sid*_*cks 0

您主要需要将 podfile 中的这一行更改为更高版本:

#Change this to something like '12'
platform :ios, '12'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}
Run Code Online (Sandbox Code Playgroud)