Christian
Christian

Reputation: 26387

Cordova Android apk isn't available after successful build on Azure Devops

Our time is using Azure Devops and we want to build an Android App via Cordova. Given that the Cordova integration from Microsoft is unfortunately deprecated and doesn't support newer versions of Cordova, my approach is to build the apk via an npm task.

- task: Npm@1
  displayName: 'build android cordova app'
  inputs:
    command: custom
    verbose: true
    customCommand: 'run cordova-build-android'

Afterwards, I want to sign it via:

- task: AndroidSigning@3
  inputs:
    apkFiles: '$(Build.SourcesDirectory)/cordova/platforms/android/app/build/outputs/apk/release/app-release-unsigned.apk'
    apksignerKeystoreFile: 'xxx.keystore'
    apksignerKeystorePassword: 'xxx'

The first task runs successfully, the second fails and says it can't find the .apk even through when I run the cordova-build-android locally on my own computer the resulting .apk ends up in /cordova/platforms/android/app/build/outputs/apk/release.

Upvotes: 0

Views: 361

Answers (1)

Christian
Christian

Reputation: 26387

It turned out I had to run cordova prepare before building in the buildprocess.

  - task: Npm@1
    displayName: 'cordova prepare'
    inputs:
      command: custom
      verbose: true
      customCommand: 'run cordova-prepare'

Upvotes: 1

Related Questions