1
votes

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

1

1 Answers

0
votes

I think I found a solution to this. But I changed two things so it could be either of these things.

  1. I 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)
  2. I 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"

When doing these two things the signing task worked. Hope this helps!