gpt4 book ai didi

xamarin.ios - Azure DevOps 以 IOS 12 为目标构建 Xamarin.IOS

转载 作者:行者123 更新时间:2023-12-04 11:46:59 24 4
gpt4 key购买 nike

我有一个使用 Xamarin 编写的应用程序和 Azure Devops 上的 buildpipline。当我以 IOS 11.x 为目标时,这很好构建。但是,我想更新到 SDK 12,因为 Apple 从 2019 年 3 月开始强制执行此操作:

SDK Version Issue - This app was built with the iOS 11.4 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later.



但是当我构建时,我的 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.

基于此 article我尝试使用此脚本设置 SDK 版本:
 /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_12_0"

不幸的是,它仍然使用 11 SDK 而不是 12。
我是选择了错误的 Mono 版本还是选择 Xamarin.IOS SDK 的错误方法?

我为 IOS 作业构建的完整 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)'

最佳答案

您现在应该可以根据 this documentation 选择正确版本的 Mono 和 Xcode .在构建和发布管道(分别在 Xamarin.iOS 构建任务和发布任务之前)的 Azure DevOps 中,我添加了一个运行以下命令的命令行任务:

echo 'Updating fastlane...'
sudo gem install fastlane

echo 'Selecting Mono version...'
/bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_16_0"

echo 'Selecting Xcode version...'
/bin/bash -c "echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'/Applications/Xcode_10.1.app;sudo xcode-select --switch /Applications/Xcode_10.1.app/Contents/Developer"

关于xamarin.ios - Azure DevOps 以 IOS 12 为目标构建 Xamarin.IOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53811111/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com