Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Sign Android app Bundle with azure pipeline

How to Sign Android App Bundle with the azure pipeline,

The documentation is available only signing APK https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/android-signing?view=azure-devops

when I try to sign aab with the above task I am getting below error

Error: Failed to deduce min API Level: APK does not contain AndroidManifest.xml. Please specify --min-sdk-version.

like image 705
user3090393 Avatar asked Dec 19 '19 07:12

user3090393


3 Answers

Answered here: https://stackoverflow.com/a/69835335/168510

Change the apkFiles to **/*.aab and pass the algorithms, -sigalg SHA256withRSA -digestalg SHA-256 as jarsignerArguments.

Like this:

- task: AndroidSigning@2
  inputs:
     apkFiles: '**/*.aab' 
     jarsign: true 
     jarsignerKeystoreFile: 'pathToYourKeystoreFile'
     jarsignerKeystorePassword: '$(jarsignerKeystorePassword)'
     jarsignerKeystoreAlias: '$(yourKeystoreAlias)'
     jarsignerKeyPassword: '$(jarsignerKeyPassword)'
     jarsignerArguments: '-sigalg SHA256withRSA -digestalg SHA-256'
     zipalign: true
like image 137
Peter Avatar answered Sep 21 '22 18:09

Peter


How to Sign Android app Bundle with azure pipeline

AFAIK, you could sign Android app Bundle from command line:

jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore xample.jks bundle.aab keystoreAlias

The jarsigner.exe is in the bin folder of your java JDK install (Java SE), so we could get it by:

"%JAVA_HOME%"\bin\jarsigner.exe

So, we could use the command line task to invoke the jarsigner.exe to sign Android app Bundle in the Azure pipeline.

Check this ticket for some more details.

Hope this helps.

like image 45
Leo Liu-MSFT Avatar answered Sep 20 '22 18:09

Leo Liu-MSFT


I had same problem with signing the Android app bundle, Right now we fixed this issue with the signing app bundle in the Azure Build Pipeline instead of signing Android app bundle from the Azure Release pipeline through jarsigner.

like image 20
BHAR4T Avatar answered Sep 19 '22 18:09

BHAR4T