繁体   English   中英

Azure Devops macOS 管道在托管时因缺少配置文件而失败

[英]Azure Devops macOS Pipeline fails on hosted with missing provisioning profile

我正在运行一个 Azure DevOps 管道,它生成一个.ipa 文件。 这在我的本地代理上运行没有任何问题,但是当我在托管的 macOS 10.15 机器上运行它时,我会收到一个错误,即缺少配置文件

❌ error: No profiles for 'app.zookeeper.platypus' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'app.zookeeper.platypus'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')

- task: InstallAppleProvisioningProfile@1
  displayName: 'Install an Apple provisioning profile'
  inputs:
    provProfileSecureFile: App.mobileprovision

- task: InstallAppleCertificate@2
  displayName: 'Install an Apple certificate'
  inputs:
    certSecureFile: 'Certs.p12'
    certPwd: xxx

- task: Xcode@5
  displayName: 'Xcode archive'
  inputs:
    actions: archive
    xcWorkspacePath: 'src/Apps/App/ios/Runner.xcworkspace'
    scheme: Runner
    packageApp: true
    archivePath: 'src/Apps/App/ios/Runner.xcarchive'
    exportPath: '$(build.artifactstagingdirectory)'
    signingOption: auto

这是安装配置文件任务的 output

Starting: Install an Apple provisioning profile
==============================================================================
Task         : Install Apple provisioning profile
Description  : Install an Apple provisioning profile required to build on a macOS agent machine
Version      : 1.171.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/install-apple-provisioning-profile
==============================================================================
/usr/bin/security cms -D -i /Users/runner/work/_temp/platypus.mobileprovision
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>AppIDName</key>
    <string>Platypus identifier</string>
    <key>ApplicationIdentifierPrefix</key>
    <array>
    <string>UM3UVMPGY5</string>
    </array>
    <key>CreationDate</key>
    <date>2020-07-31T14:08:38Z</date>
    <key>Platform</key>
    <array>
        <string>iOS</string>
    </array>
    <key>IsXcodeManaged</key>
    <false/>
    <key>DeveloperCertificates</key>
    <array>
        <data>MIIF...</data> <- shortened for better reading
        <data>MIIF...</data> <- shortened for better reading
        <data>MIIF...</data> <- shortened for better reading
    </array>

                                        
    <key>Entitlements</key>
    <dict>
                
                <key>application-identifier</key>
        <string>UM3UVMPGY5.app.zookeeper.platypus</string>
                <key>keychain-access-groups</key>
        <array>
                <string>UM3UVMPGY5.*</string>
                <string>com.apple.token</string>
        </array>
                
                <key>get-task-allow</key>
        <true/>
                
                <key>com.apple.developer.team-identifier</key>
        <string>UM3UVMPGY5</string>
                <key>com.apple.developer.authentication-services.autofill-credential-provider</key>
        <true/>

    </dict>
    <key>ExpirationDate</key>
    <date>2021-07-31T14:08:38Z</date>
    <key>Name</key>
    <string>platypus</string>
    <key>ProvisionedDevices</key>
    <array>
        <string>00008030-0011193A11D8802E</string>
    </array>
    <key>TeamIdentifier</key>
    <array>
        <string>UM3UVMPGY5</string>
    </array>
    <key>TeamName</key>
    <string>Daniel Martin</string>
    <key>TimeToLive</key>
    <integer>365</integer>
    <key>UUID</key>
    <string>19e4f1a2-a4fd-42f6-ac17-b8bc864fa1d7</string>
    <key>Version</key>
    <integer>1</integer>
</dict>
/usr/libexec/PlistBuddy -c Print UUID _xcodetasktmp.plist
19e4f1a2-a4fd-42f6-ac17-b8bc864fa1d7
/usr/libexec/PlistBuddy -c Print Name _xcodetasktmp.plist
platypus
/bin/rm -f _xcodetasktmp.plist
/bin/cp -f /Users/runner/work/_temp/platypus.mobileprovision /Users/runner/Library/MobileDevice/Provisioning Profiles/19e4f1a2-a4fd-42f6-ac17-b8bc864fa1d7.mobileprovision
Finishing: Install an Apple provisioning profile

而失败的 XCOde 归档任务:

Starting: Xcode archive
==============================================================================
Task         : Xcode
Description  : Build, test, or archive an Xcode workspace on macOS. Optionally package an app.
Version      : 5.170.2
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/xcode
==============================================================================
/usr/bin/xcodebuild -version
Xcode 11.3.1
Build version 11C505
/usr/bin/xcodebuild -configuration $(Configuration) -workspace /Users/runner/work/1/s/src/Apps/platypus_app/ios/Runner.xcworkspace -scheme Runner archive CODE_SIGN_STYLE=Automatic | /usr/local/lib/ruby/gems/2.6.0/bin/xcpretty -r junit --no-color

❌  error: No profiles for 'app.zookeeper.platypus' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'app.zookeeper.platypus'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')


** ARCHIVE FAILED **

##[error]Error: /usr/bin/xcodebuild failed with return code: 65
Finishing: Xcode archive

我是Apple证书的初学者,所以我想我在这里遗漏了一些东西感谢您的帮助!

编辑

设置后

signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'

我会收到一堆新的错误。

❌  error: image_picker does not support provisioning profiles. image_picker does not support provisioning profiles, but provisioning profile platypus has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'image_picker' from project 'Pods')

❌  error: flutter_secure_storage does not support provisioning profiles. flutter_secure_storage does not support provisioning profiles, but provisioning profile platypus has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'flutter_secure_storage' from project 'Pods')

❌  error: MTBBarcodeScanner does not support provisioning profiles. MTBBarcodeScanner does not support provisioning profiles, but provisioning profile platypus has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'MTBBarcodeScanner' from project 'Pods')

❌  error: sqflite does not support provisioning profiles. sqflite does not support provisioning profiles, but provisioning profile platypus has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'sqflite' from project 'Pods')

❌  error: Pods-Runner does not support provisioning profiles. Pods-Runner does not support provisioning profiles, but provisioning profile platypus has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'Pods-Runner' from project 'Pods')

❌  error: Provisioning profile "platypus" doesn't include signing certificate "iPhone Distribution: Daniel Martin (UM3UVMPGY5)". (in target 'Runner' from project 'Runner')

❌  error: path_provider does not support provisioning profiles. path_provider does not support provisioning profiles, but provisioning profile platypus has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor. (in target 'path_provider' from project 'Pods')

这些都是我包含在我的 flutter 应用程序中的所有包。

确保您已将配置文件 &.p12 文件上传到管道库。 之后,您可以将其包含在Podfile的末尾:

post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
        config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
    end
end

有关更多信息,请参阅这篇文章

您可以查看 InstallAppleProvisioningProfile 任务的任务日志,以查看配置文件是否已成功下载到代理中。 确保将正确的配置文件上传到安全文件(管道-->库--安全文件>)并在运行时下载到代理。

如果配置文件已成功下载。 可能是因为 xcode 的版本不同。

您可以查看构建日志以查看云托管代理中的 xcode 任务使用的 xcode 版本是否与您的本地代理相同。

您可以使用xcodeVersion属性为 Xcode 任务指定 Xcode 的目标版本。

- task: Xcode@5
  displayName: 'Xcode task'
  inputs:
    xcodeVersion: 11
    packageApp: true
    signingOption: auto

更新:

如果不是 xcode 版本问题。 您可以尝试将provisioningProfileUuid属性设置为$(APPLE_PROV_PROFILE_UUID) :见下文:

- task: Xcode@5
  inputs:
    signingOption: 'manual'
    signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
    provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'

在这里查看更多信息。

写此评论以防有人遇到类似问题。 在我的情况下,问题是证书是 Development 而不是 Adhoc,所以当我创建一个 Adhoc 证书并添加它而不是开发证书时它起作用了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM