0

Getting the Apps must contain a provisioning profile in a file named embedded.mobileprovision error. I have added the "'args: '-UseModernBuildSystem=0'" even then facing the same issue.

      - task: InstallAppleCertificate@2
        inputs:
          certSecureFile: 'cert.p12'
          certPwd: '$(certpasswd)'

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

      - task: Xcode@5
        displayName: 'Xcode Development Release'
        inputs:
          actions: 'archive'
          sdk: '$(sdk)'
          scheme: '$(scheme)'
          xcWorkspacePath: '**/*.xcodeproj'
          exportOptions: 'specify'
          exportMethod: 'app-store'
          archivePath: '$(Build.SourcesDirectory)/build/iOSApp.xcarchive'
          exportPath: '$(Build.SourcesDirectory)/build/output'
          teamId: '$(TeamId)'
          exportTeamId: '$(ExportTeamId)'
          packageApp: true
          signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
          provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
          args: '-UseModernBuildSystem=0'
      
      - task: AppStoreRelease@1
        inputs:
          serviceEndpoint: '$(ServiceEndpoint)'
          appIdentifier: '$(AppIdentifier)'
          appType: 'iOS'
          releaseTrack: 'TestFlight'
          shouldSkipWaitingForProcessing: true
          shouldSkipSubmission: true
so9868
  • 105
  • 10

2 Answers2

0

You could check if the embedded.mobileprovision exists and the file location. From this answer, the file needs to exist in root of folder. If it doesn't exist, you could use Copy file task to copy the file to the root before packing.

- task: CopyFiles@2
        inputs:
            contents: '**/*.ipa'
            targetFolder: '$(build.artifactStagingDirectory)'
- task: PublishBuildArtifacts@1
- task: AppStoreRelease@1
    inputs:
        authType: 'UserAndPass'
        username: '$(user)'
        password: '$(pass)'
        appIdentifier: 'App Identifier'
        appType: 'iOS'
        ipaPath: '$(build.artifactStagingDirectory)/**/*.ipa'
        releaseTrack: 'TestFlight'
        teamId: 'Team ID'
        teamName: 'Team Name'
        fastlaneArguments: 'action increment_build_number'

In addition, here is a ticket with the same issue you can refer to.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
0

It probably was caused by your ipa not being correctly signed. The default value of signingOption property is nosign. if you didnot specifically assign a value to signingOption of Xcode. You ipa will not be signed. So if your ipa needs to be signed. You need to assign manual or auto to signingOption property. See this more Xcode task Arguments here.

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

Please check examples here.

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43