Azure Devops macOS Pipeline 在托​​管时失败,缺少配置文件

Dan*_*tin 6 xcode azure ios azure-devops azure-pipelines

我正在运行生成 .ipa 文件的 Azure DevOps Pipeline。它在我的本地代理上运行没有任何问题,但是当我在托管 macOS 10.15 计算机上运行它时,我会收到一个错误,提示配置文件丢失

\n

\xe2\x9d\x8c 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')

\n
- task: InstallAppleProvisioningProfile@1\n  displayName: 'Install an Apple provisioning profile'\n  inputs:\n    provProfileSecureFile: App.mobileprovision\n\n- task: InstallAppleCertificate@2\n  displayName: 'Install an Apple certificate'\n  inputs:\n    certSecureFile: 'Certs.p12'\n    certPwd: xxx\n\n- task: Xcode@5\n  displayName: 'Xcode archive'\n  inputs:\n    actions: archive\n    xcWorkspacePath: 'src/Apps/App/ios/Runner.xcworkspace'\n    scheme: Runner\n    packageApp: true\n    archivePath: 'src/Apps/App/ios/Runner.xcarchive'\n    exportPath: '$(build.artifactstagingdirectory)'\n    signingOption: auto\n
Run Code Online (Sandbox Code Playgroud)\n

这是安装配置文件任务的输出

\n
Starting: Install an Apple provisioning profile\n==============================================================================\nTask         : Install Apple provisioning profile\nDescription  : Install an Apple provisioning profile required to build on a macOS agent machine\nVersion      : 1.171.0\nAuthor       : Microsoft Corporation\nHelp         : https://learn.microsoft.com/azure/devops/pipelines/tasks/utility/install-apple-provisioning-profile\n==============================================================================\n/usr/bin/security cms -D -i /Users/runner/work/_temp/platypus.mobileprovision\n<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">\n<plist version="1.0">\n<dict>\n    <key>AppIDName</key>\n    <string>Platypus identifier</string>\n    <key>ApplicationIdentifierPrefix</key>\n    <array>\n    <string>UM3UVMPGY5</string>\n    </array>\n    <key>CreationDate</key>\n    <date>2020-07-31T14:08:38Z</date>\n    <key>Platform</key>\n    <array>\n        <string>iOS</string>\n    </array>\n    <key>IsXcodeManaged</key>\n    <false/>\n    <key>DeveloperCertificates</key>\n    <array>\n        <data>MIIF...</data> <- shortened for better reading\n        <data>MIIF...</data> <- shortened for better reading\n        <data>MIIF...</data> <- shortened for better reading\n    </array>\n\n                                        \n    <key>Entitlements</key>\n    <dict>\n                \n                <key>application-identifier</key>\n        <string>UM3UVMPGY5.app.zookeeper.platypus</string>\n                <key>keychain-access-groups</key>\n        <array>\n                <string>UM3UVMPGY5.*</string>\n                <string>com.apple.token</string>\n        </array>\n                \n                <key>get-task-allow</key>\n        <true/>\n                \n                <key>com.apple.developer.team-identifier</key>\n        <string>UM3UVMPGY5</string>\n                <key>com.apple.developer.authentication-services.autofill-credential-provider</key>\n        <true/>\n\n    </dict>\n    <key>ExpirationDate</key>\n    <date>2021-07-31T14:08:38Z</date>\n    <key>Name</key>\n    <string>platypus</string>\n    <key>ProvisionedDevices</key>\n    <array>\n        <string>00008030-0011193A11D8802E</string>\n    </array>\n    <key>TeamIdentifier</key>\n    <array>\n        <string>UM3UVMPGY5</string>\n    </array>\n    <key>TeamName</key>\n    <string>Daniel Martin</string>\n    <key>TimeToLive</key>\n    <integer>365</integer>\n    <key>UUID</key>\n    <string>19e4f1a2-a4fd-42f6-ac17-b8bc864fa1d7</string>\n    <key>Version</key>\n    <integer>1</integer>\n</dict>\n/usr/libexec/PlistBuddy -c Print UUID _xcodetasktmp.plist\n19e4f1a2-a4fd-42f6-ac17-b8bc864fa1d7\n/usr/libexec/PlistBuddy -c Print Name _xcodetasktmp.plist\nplatypus\n/bin/rm -f _xcodetasktmp.plist\n/bin/cp -f /Users/runner/work/_temp/platypus.mobileprovision /Users/runner/Library/MobileDevice/Provisioning Profiles/19e4f1a2-a4fd-42f6-ac17-b8bc864fa1d7.mobileprovision\nFinishing: Install an Apple provisioning profile\n
Run Code Online (Sandbox Code Playgroud)\n

以及失败的 XCOde 归档任务:

\n
Starting: Xcode archive\n==============================================================================\nTask         : Xcode\nDescription  : Build, test, or archive an Xcode workspace on macOS. Optionally package an app.\nVersion      : 5.170.2\nAuthor       : Microsoft Corporation\nHelp         : https://learn.microsoft.com/azure/devops/pipelines/tasks/build/xcode\n==============================================================================\n/usr/bin/xcodebuild -version\nXcode 11.3.1\nBuild version 11C505\n/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\n\n\xe2\x9d\x8c  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')\n\n\n** ARCHIVE FAILED **\n\n##[error]Error: /usr/bin/xcodebuild failed with return code: 65\nFinishing: Xcode archive\n
Run Code Online (Sandbox Code Playgroud)\n

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

\n

编辑

\n

设置后

\n
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'\nprovisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'\n
Run Code Online (Sandbox Code Playgroud)\n

我会收到一堆新的错误。

\n
\xe2\x9d\x8c  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')\n\n\xe2\x9d\x8c  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')\n\n\xe2\x9d\x8c  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')\n\n\xe2\x9d\x8c  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')\n\n\xe2\x9d\x8c  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')\n\n\xe2\x9d\x8c  error: Provisioning profile "platypus" doesn't include signing certificate "iPhone Distribution: Daniel Martin (UM3UVMPGY5)". (in target 'Runner' from project 'Runner')\n\n\xe2\x9d\x8c  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')\n
Run Code Online (Sandbox Code Playgroud)\n

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

\n

小智 4

确保您已将配置文件和 .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
Run Code Online (Sandbox Code Playgroud)

欲了解更多信息,请参阅这篇文章