title: Android Azure Devops Gradle build failing on signing apk w zipalign, exit code 1
body: <p>I have an android app and I am trying to set up the CICD in Azure Devops for our team.
  However I cannot get the &quot;Build&quot; stage to complete.
  It fails in the &quot;Android Signing&quot; sub-task with error message:</p>
  <h2>[error]Error: The process '/Users/vsts/Library/Android/sdk/build-tools/19.1.0/zipalign' failed with exit code 1</h2>
  <p>It works when I deselect the optional &quot;zipalign&quot; feature on the signing task. But as I've read you are not supposed to deploy applications without using zipalign first.</p>
  <p>The app is built in Android Studio (Kotlin). All similar issues I have found online have been related to xamarin, which I am not using at this point.</p>
  <p>I am deploying on a arm64 device if that is relevant. Building and signing in Android Studio is no problem (Although I am not sure if it uses the zipalign by default there as it is not clear from using the Generate Signed APK wizard. I would assume it will do it for you without asking?).
  Anyways I'm of course trying to automate the build-deploy in DevOps on pull-requests to the master branch, which is how I usually do it with other projects.</p>
  <p>Here is my azure-pipelines.yaml</p>
  <pre><code># Android
  # Build your Android project with Gradle.
  # Add steps that test, sign, and distribute the APK, save build artifacts, and more:
  # https://docs.microsoft.com/azure/devops/pipelines/languages/android
  
  trigger:
  - master
  
  pool:
    vmImage: 'macos-latest'
  
  steps:
  - task: Gradle@2
    inputs:
      workingDirectory: ''
      gradleWrapperFile: 'gradlew'
      gradleOptions: '-Xmx3072m'
      publishJUnitResults: false
      testResultsFiles: '**/TEST-*.xml'
      tasks: 'assembleDebug'
  
  - task: AndroidSigning@3
    inputs:
      apkFiles: '**/*.apk'
      apksignerKeystoreFile: 'key.jks'
      apksignerKeystorePassword: 'XXXX'
      apksignerKeystoreAlias: 'key0'
      apksignerKeyPassword: 'XXXX'
  
  - task: CopyFiles@2
    inputs:
      contents: '**/*.apk'
      targetFolder: '$(build.artifactStagingDirectory)'
  - task: PublishBuildArtifacts@1
    inputs:
      PathtoPublish: '$(Build.ArtifactStagingDirectory)'
      ArtifactName: 'drop'
      publishLocation: 'Container'
  </code></pre>
  <p>The tail-end of the log below. I am getting a bunch of (BAD - 1-2-3) messages for various resources. Not sure if this is related to the error itself.</p>
  <p><a href="https://i.stack.imgur.com/EDz0i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EDz0i.png" alt="enter image description here" /></a></p>