Search code examples
azure-pipelinesvisual-studio-app-center

AppCenterDistribute: EISDIR: illegal operation on a directory, read


I'm trying to upload my built apk to the App Center, but I'm encountering the following error:

##[error]Error: EISDIR: illegal operation on a directory, read

I'm guessing the file path is incorrect in the AppCenterDistribute task, but I can't figure out what is expected

enter image description here

enter image description here

- task: CopyFiles@2
  displayName: 'Copy APK'
  inputs:
    contents: '**/*.apk'
    targetFolder: '$(build.artifactStagingDirectory)'
    overWrite: true
    flattenFolders: true

- task: PublishBuildArtifacts@1
  displayName: 'Publish APK to artifacts'
  inputs:
    pathtoPublish: $(build.artifactStagingDirectory)
    artifactName: 'android'
    publishLocation: 'Container'

- task: AppCenterDistribute@3
  displayName: 'Upload APK to AppCenter'
  inputs:
    serverEndpoint: 'App Center'
    appSlug: 'careline-solutions/CarelineMobile'
    appFile: $(build.artifactStagingDirectory)/app-release.apk
    releaseNotesOption: 'file'
    isMandatory: true
    destinationType: 'groups'
    distributionGroupId: '6cd3af0f-a8a2-4704-9c28-7244c9b29042'
    isSilent: true

I tried adding the following script after the PublishBuildArtifact task:

- script: |
    cd $(build.artifactStagingDirectory)
    ls

Output is app-release.apk so the path seems right.


Solution

  • The error message is not very helpful, but you have not set releaseNotesFile on task: AppCenterDistribute@3

    See docs: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/app-center-distribute?view=azure-devops

    releaseNotesFile: # Required when releaseNotesOption == File