Home:ALL Converter>Invalid Keystore Format - Signing Android APK in Azure DevOps build pipeline

Invalid Keystore Format - Signing Android APK in Azure DevOps build pipeline

Ask Time:2019-05-17T03:05:19         Author:Samantha

Json Formatter

I have a Xamarin Android application that I want to generate a signed APK for using the Azure DevOps build pipeline.

Right now, I receive a java.io.IOException: Invalid keystore format.

I generated the keystore file from the command line with the following command:

keytool.exe -genkeypair -v -keystore myAppName.keystore -alias myAppNamekey -keyalg RSA -keysize 2048 -validity 10000

This keystore works on my local device.

I also tried adding the default debug.keystore file to the azure pipeline, and that works successfully.

I added the key to my (already working) CI build pipeline in Azure DevOps, under the "Signing and Aligning" section.

When it reaches this section, I receive the following error:

Failed to load signer "signer #1" java.io.IOException: Invalid keystore format [error]Error: The process 'C:\Program Files (x86)\Android\android-sdk\build-tools\24.0.3\apksigner.bat' failed with exit code 2

Author:Samantha,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/56175090/invalid-keystore-format-signing-android-apk-in-azure-devops-build-pipeline
Maximillian Coburn :

I think I found a solution to this. But I changed two things so it could be either of these things.\n\n\nI had a '!' in my keystore password. I removed that because I saw that their where issues with having special characters. (This is probably not the change that fixed it but I wanted to add this just to be sure)\nI re-generated a key with jdk1.8.0_13 version. This is path to the keytool I used \"C:\\Program Files (x86)\\Java\\jdk1.8.0_131\\jre\\bin\\keytool.exe\" \n\n\nWhen doing these two things the signing task worked. Hope this helps!",
2019-06-20T19:12:03
yy