簡體   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