我有一个使用Xamarin编写的应用程序,在Azure Devops上有一个构建管道。当我针对IOS 11.x进行目标构建时,它可以成功构建。但是,自从2019年3月起苹果开始强制要求使用SDK 12或更高版本来构建应用程序:
根据这篇文章,我尝试使用以下脚本设置SDK版本:
SDK版本问题 - 此应用程序是使用iOS 11.4 SDK构建的。从2019年3月开始,提交到App Store的所有iOS应用都必须使用iOS 12.1 SDK或更高版本进行构建,其中包括Xcode 10.1或更高版本。
但是,当我在Azure Devops管道中构建时,总是会出现以下错误:
MTOUCH : error MT0074: Xamarin.iOS 11.14.0 does not support a deployment target of 12.0 for iOS (the maximum is 11.4). Please select an older deployment target in your project's Info.plist or upgrade to a newer version of Xamarin.iOS.
根据这篇文章,我尝试使用以下脚本设置SDK版本:
/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_12_0"
很遗憾,它仍然使用的是11 SDK而不是12 SDK。 我选择了错误的Mono版本还是选择了错误的方法来选择Xamarin.IOS SDK?
我的IOS Job完整的构建YAML:
queue:
name: Hosted macOS
demands:
- xcode
- Xamarin.iOS
steps:
- bash: |
echo "Select Xamarin Version"
/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_12_0"
displayName: 'Select Xamarin Version'
- task: InstallAppleCertificate@2
displayName: 'Install an Apple certificate'
inputs:
certSecureFile: '6f1c094d-c147-41e0-9bc6-c9fe9a40b2e6'
certPwd: '$(P12password)'
- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provProfileSecureFile: 'a883a983-6027-4382-afd4-94b52736323c'
- task: NuGetToolInstaller@0
displayName: 'Use NuGet'
inputs:
versionSpec: 4.x
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
- task: XamariniOS@2
displayName: 'Build Xamarin.iOS '
inputs:
solutionFile: Src/MoneyFox.Ios/MoneyFox.iOS.csproj
configuration: '$(BuildConfiguration)'
/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_0_0"
。 - Artemious