Thursday, December 7, 2023
HomeiOS DevelopmentAzure DevOps Flutter CI/CD pipeline for iOS and watchOS app fails to...

Azure DevOps Flutter CI/CD pipeline for iOS and watchOS app fails to publish to TestFlight


I’ve an present Azure DevOps pipeline to construct the Flutter iOS app. This app contains the Watch app and Watch app extension.

I take advantage of handbook signing with an Apple Distribution certificates (.p12), and three .mobileprovision profiles (for the primary app, watchkit, and watchkit extension).

The construct pipeline builds an IPA file and begins to add the file to the TestFlight utilizing Fastlane.

Right here we get the error:

Error: Asset validation failed Invalid Code Signature Identifier. The identifier "com.apple.WK" in your code signature for "App" should match its Bundle Identifier "com.org.app.watchkitapp"

Here’s a pipeline code:

phases:
  - stage: iOSStage
    pool:
      vmImage: 'macos-latest'
    dependsOn: []
    displayName: iOS
    jobs:

      - job: iOSJob
        displayName: iOS
        variables:
          FLUTTER_XCODE_CODE_SIGN_IDENTITY: ""
          FLUTTER_XCODE_CODE_SIGNING_REQUIRED: NO
          FLUTTER_XCODE_CODE_SIGNING_ALLOWED: NO
        steps:
          - process: InstallAppleProvisioningProfile@1
            displayName: Set up most important app provisioning profile
            inputs:
              provisioningProfileLocation: 'secureFiles'
              provProfileSecureFile: 'baseapp_provisioning.mobileprovision'

          # Set up WatchKit extension provisioning profile
          - process: InstallAppleProvisioningProfile@1
            displayName: Set up WatchKit extension provisioning profile
            inputs:
              provisioningProfileLocation: 'secureFiles'
              provProfileSecureFile: 'watchkitapp_provisioning.mobileprovision'

          # Set up WatchKit app provisioning profile
          - process: InstallAppleProvisioningProfile@1
            displayName: Set up WatchKit app provisioning profile
            inputs:
              provisioningProfileLocation: 'secureFiles'
              provProfileSecureFile: 'watchkitextension_provisioning.mobileprovision'


          # exchange "iosKey" and "yourPwd" along with your safe file identify and password
          - process: InstallAppleCertificate@2
            displayName: Set up certificates
            inputs:
              certSecureFile: 'apple_distribution.p12'
              certPwd: '$(PASS)'
              keychain: 'temp'
              setUpPartitionIdACLForPrivateKey: true

          - process: FlutterInstall@0
            displayName: "Set up Flutter SDK"
            inputs:
              mode: 'auto'
              channel: 'steady'
              model: 'newest'

          - process: FlutterCommand@0
            displayName: "Run Flutter diagnostics"
            inputs:
              projectDirectory: '.'
              arguments: 'physician -v'

          - script: |
              gem set up cocoapods

          # modify path to the *.plist file
          - process: FlutterBuild@0
            displayName: "Construct software"
            inputs:
              goal: ipa
              projectDirectory: '$(Construct.SourcesDirectory)'
              buildName: '$(Construct.BuildNumber)'
              exportOptionsPlist: 'ios/ExportOptions.plist'
              debugMode: false
              profileMode: false
              verboseMode: true
              
          - process: CopyFiles@2
            displayName: "Copy app to staging listing"
            inputs:
              sourceFolder: '$(Agent.BuildDirectory)'
              contents: '**/ipa/*.ipa'
              targetFolder: '$(Construct.StagingDirectory)'
              flattenFolders: true

          - process: PublishBuildArtifacts@1
            displayName: "Publish IPA file"
            inputs:
              PathtoPublish: '$(Construct.ArtifactStagingDirectory)'
              ArtifactName: 'IPA'
              publishLocation: 'Container'

          - process: AppStoreRelease@1
            displayName: "Publish to the App Retailer TestFlight observe"
            inputs:
              authType: 'ApiKey'
              apiKeyId: 'some-key-id'
              apiKeyIssuerId: 'some-issuer-id'
              apitoken: 'base64-api-token'
              releaseTrack: 'TestFlight'
              appIdentifier: 'com.org.app'
              appType: 'iOS'
              ipaPath: '$(Construct.ArtifactStagingDirectory)/**/*.ipa'
              shouldSkipWaitingForProcessing: true
              shouldSkipSubmission: true
              appSpecificId: '1234'
              teamId: 'some-id'
              teamName: 'my-team'
            enabled: true
            timeoutInMinutes: 30
            retryCountOnTaskFailure: 1

And the ExportOptions.plist

<?xml model="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist model="1.0">
<dict>
    <key>compileBitcode</key>
    <false/> <!-- Alter based mostly in your desire -->
    <key>uploadBitcode</key>
    <false/> <!-- Alter based mostly in your desire -->
    <key>uploadSymbols</key>
    <false/> <!-- Alter based mostly in your desire -->
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>SOME-TEAM-ID</string>
    <key>technique</key>
    <string>app-store</string>
    <key>signingStyle</key>
    <string>handbook</string>
    <key>signingCertificate</key>
    <string>Apple Distribution: ORG (ORG_ID)</string> <!-- Change along with your certificates identify -->
    <key>provisioningProfiles</key>
    <dict>
        <key>com.org.app</key>
        <string>baseapp_provisioning</string> <!-- Change along with your provisioning profile identify -->
        <key>com.org.app.watchkitapp</key>
        <string>watchkitapp_provisioning</string> <!-- Change along with your provisioning profile identify -->
        <key>com.org.app.watchkitapp.watchkitextension</key>
        <string>watchkitextension_provisioning</string> <!-- Change along with your provisioning profile identify -->
    </dict>
</dict>
</plist>

I am caught on this error for a number of days and do not have an concept the place else to search for resolution.

I attempted to generate various kinds of certificates (.p12) and .mobileprovision profiles. I attempted completely different flags for signing within the pipeline, however I can not get previous this error.

I suppose the issue is both with iOS (watchOS) settings, ExportOptions, DevOps construct pipeline, or certificates.

If every thing would work this pipeline ought to publish IPA file to the TestFlight.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments