microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.49k stars 2.61k forks source link

AppCenterDistribute cannot find aab file despite the artifact being successfully downloaded #14997

Closed munkii closed 3 years ago

munkii commented 3 years ago

Type: Bug

Enter Task Name: AppCenterDistribute@3

Environment

Issue Description

We have a two stage pipeline where the first stage builds a Xamarin Android package with an AAB. At the end of the first stage we publish that artifact using the PublishPielineArtifact

- task: PublishPipelineArtifact@1
      displayName: 'Publishing aab artifacts'
      inputs:          
        targetPath: '$(Build.BinariesDirectory)'
        artifact: AndroidAabPackage
        publishLocation: 'pipeline'

In the second stage we download that artifact using DownloadPipelineArtifact

    - task: DownloadPipelineArtifact@2
      displayName: 'Downloading aab package'
      inputs:
        buildType: 'current'
        artifactName: 'AndroidAabPackage'
        itemPattern: '**/com.OurCompany.OurApp.aab'
        targetPath: '$(Build.SourcesDirectory)\Artifacts'

The output of that download suggests success to me

Download from the specified build: #7551
Download artifact to: D:\a\1\s\Artifacts
ApplicationInsightsTelemetrySender will correlate events with X-TFS-Session c4713aa1-09fb-43d7-b0b9-ff15ed89a136
DedupManifestArtifactClient will correlate http requests with X-TFS-Session c4713aa1-09fb-43d7-b0b9-ff15ed89a136
Minimatch patterns: [**/com.MagicBullet.ProjectBreatheApp.aab]
Filtered 1 files from the Minimatch filters supplied.
Downloaded 0.0 MB out of 25.6 MB (0%).
Downloaded 25.6 MB out of 25.6 MB (100%).

Download statistics:
Total Content: 25.6 MB
Physical Content Downloaded: 25.3 MB
Compression Saved: 0.3 MB
Local Caching Saved: 0.0 MB
Chunks Downloaded: 329
Nodes Downloaded: 0

Download completed.
ApplicationInsightsTelemetrySender correlated 2 events with X-TFS-Session c4713aa1-09fb-43d7-b0b9-ff15ed89a136
Downloading artifact finished.
##[section]Finishing: Downloading aab package

25MB is the size I'd expect for the AAB

Next we have the AppCenterDistributeTask (version 3)

    - task: AppCenterDistribute@3
      displayName: 'Deploy $(Build.SourcesDirectory)\Artifacts/*.aab to Visual Studio App Center'
      inputs:
        serverEndpoint: 'Visual Studio App Center 2020'
        appSlug: 'OurCompany/OurProject'
        appFile: '$(Build.SourcesDirectory)/Artifacts/com.OurProject.OurApp.aab'
        symbolsIncludeParentDirectory: false
        releaseNotesInput: |
         This is a build of our master $(Build.SourceBranch) branch for testing prior to App Center distribution to ALPHA testers.

         Release notes for the Pre-Alpha release (DEV-TEST) will go here.
        distributionGroupId: '[AGUID]'

However when this runs the output is

[error]Error: Cannot find any file based on D:\a\1\s\Artifacts\com.MagicBullet.ProjectBreatheApp-Signed.aab.

Why can it not find the AAB

munkii commented 3 years ago

This was as simple as me not wildcarding a recursive appFile path in the AppCenterDistribute task

appFile: '$(Build.SourcesDirectory)/Artifacts/**/com.OurProject.OurApp.apk'

Yes, I have swicthed to APK too but I had the same issue with IPA (iOS) all now fixed with "**". Fresh yes this morning allowed me to see my stupidity. Apologies for any wasted time