Xamarin iOS构建的DevOps CI错误在钥匙串中找不到有效的iOS代码签名密钥 [英] DevOps CI error for Xamarin iOS build No valid iOS code signing keys found in keychain

查看:77
本文介绍了Xamarin iOS构建的DevOps CI错误在钥匙串中找不到有效的iOS代码签名密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为Xamarin iOS应用程序创建了YAML构建配置,并提供了证书文件(p12和mobileprovision),但是当管道运行时,它在应用程序的构建步骤中失败.证书的安装通过.

I have created a YAML build configuration for my Xamarin iOS app and have provided the certificate files ( p12 and mobileprovision ) but when the pipeline runs, it fails on the build step for the app. The installation for the certificates pass.

注意,具有相同证书文件和密码的版本可以在App Center上正常运行

Note the build with same cert files and password work fine on App Center

在DevOps中,出现以下错误:

In DevOps I get the below error:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(646,3):错误:在钥匙串中找不到有效的iOS代码签名钥匙.你需要从 https://developer.apple.com 申请代码签名证书.[/Users/vsts/agent/2.150.3/work/1/s/AwesomeApp/AwesomeApp.iOS/AwesomeApp.iOS.csproj]

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(646,3): error : No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com. [/Users/vsts/agent/2.150.3/work/1/s/AwesomeApp/AwesomeApp.iOS/AwesomeApp.iOS.csproj]

以下是我在Azure DevOps中的知识点

Below is my yaml in Azure DevOps:

- job: iOS
pool:
  vmImage: 'macos-latest'

steps:
- script: sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_12_0
  displayName: 'Select the Xamarin SDK version'
  enabled: false

- task: NuGetToolInstaller@0

- task: NuGetCommand@2
  inputs:
    restoreSolution: '**/*.sln'

- task: InstallAppleProvisioningProfile@1
  inputs:
    provisioningProfileLocation: 'secureFiles'
    provProfileSecureFile: 'iOS_Distribution.mobileprovision'

- task: InstallAppleCertificate@2
  inputs:
    certSecureFile: 'ios_distribution.p12'
    certPwd: '$(p12-password)'
    keychain: 'temp'

- task: XamariniOS@2
  inputs:
    solutionFile: '**/*.sln'
    configuration: 'Ad-Hoc'
    buildForSimulator: false
    packageApp: false

我在yaml上尝试了各种不同的选项,但仍然收到错误.

I have tried various different options on the yaml but still get the error.

推荐答案

不应该设置以下属性:

- task: InstallAppleCertificate@2
    inputs:
    certSecureFile: 'ios_distribution.p12'
    certPwd: '$(P12password)'
    keychain: 'temp'

- task: InstallAppleProvisioningProfile@1
    inputs:
    provisioningProfileLocation: 'secureFiles'
    provProfileSecureFile: 'iOS_Distribution.mobileprovision'

- task: XamariniOS@2
    displayName: Build iOS App 
    inputs:
    solutionFile: '$(SolutionFile)'
    configuration: '$(BuildConfiguration)'
    buildForSimulator: false
    packageApp: true
    # This value is automatically set by the InstallAppleCertificate task
    signingIdentity: $(APPLE_CERTIFICATE_SIGNING_IDENTITY)
    # This value is automatically set by the InstallAppleProvisioningProfile task
    signingProvisioningProfileID: $(APPLE_PROV_PROFILE_UUID)

这里的关键位是 XamariniOS @ 2 任务上的 signingIdentity signingProvisioningProfileID .

The key bit here is the signingIdentity and signingProvisioningProfileID on the XamariniOS@2 task.

这篇关于Xamarin iOS构建的DevOps CI错误在钥匙串中找不到有效的iOS代码签名密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆