Uploading from Azure Pipeline fails but works from terminal

52 Views Asked by At

I am working to get the azure pipeline yaml to upload the generated apk from the build. The build agent is a Windows machine. I am working from a mac terminal. When I upload from the mac terminal, there is no problem with uploading.

When I attempt to upload or distribute from the azure devops pipeline, it gives me this error.

Error: Unsupported file format, should be .ipa, .apk or .aab

The step that fails in the yaml

- script: |
    firebase appdistribution:distribute '$(Build.SourcesDirectory)\build\app\outputs\flutter-apk\myapp.apk'  --app "$(FIREBASE_APP_ID)" --token "$(FIREBASE_TOKEN)" 

I have tried double backslash, forward slash in the path, but it does not seem to solve it. Any input is appreciated.

I expect the apk to be uploaded to firebase app distribution. It works from the mac terminal.

Updates: Using path expressions inside of the yaml script causes the firebase tool to not ignore the ending quote. https://github.com/firebase/firebase-tools/blob/master/src/appdistribution/distribution.ts. So I changed that script or step to change the working directory and use just the name of the apk.

- task: CmdLine@2
  displayName: 'Deploy APK to Firebase'
  inputs:
    workingDirectory: '$(Build.SourcesDirectory)\build\app\outputs\flutter-apk'
    script: |
      firebase appdistribution:distribute myapp.apk  --app "$(my-firebase-appid)" --token "$(FIREBASE_TOKEN)" 
0

There are 0 best solutions below