I'm on an apprenticeship in the UK.
I'm trying to make a simple app that uses google maps with Xamarin for both iOS and Android.
My app just needs to display some objects overlaying them on the map using geolocalization
First of all I need to be able to use google maps with Visual Studio + Xamarin
I'm stuck at the first step where I have to retrieve the fingerprint from my keystore.
I'm running visual studio 2022
I've seen
here
there's quite a lot of steps to go through.
This is one command I've tried from a cmd run from the jre folder
C:\Program Files\Java\jre1.8.0_291\bin>keytool.exe -list -v -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey
Enter keystore password:
I have tried with android, then changeme and changeit but still the same output as follows
keytool error: java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
at sun.security.provider.KeyStoreDelegator.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
at sun.security.tools.keytool.Main.doCommands(Unknown Source)
at sun.security.tools.keytool.Main.run(Unknown Source)
at sun.security.tools.keytool.Main.main(Unknown Source)
I've tried also to state what the password is manually. The following example shows what I get using android as a password. The results are identical for changeme and changeit
C:\Program Files\Java\jre1.8.0_291\bin>keytool.exe -list -v -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
keytool error: java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
at sun.security.provider.KeyStoreDelegator.engineLoad(Unknown Source)
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(Unknown Source)
at java.security.KeyStore.load(Unknown Source)
at sun.security.tools.keytool.Main.doCommands(Unknown Source)
at sun.security.tools.keytool.Main.run(Unknown Source)
at sun.security.tools.keytool.Main.main(Unknown Source)
This is what I get if I don't provide any password:
C:\Program Files\Java\jre1.8.0_291\bin>keytool.exe -list -v -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey
Enter keystore password:
I have literally just pressed enter here without typing anything. Just enter
***************** WARNING WARNING WARNING *****************
* The integrity of the information stored in your keystore *
* has NOT been verified! In order to verify its integrity, *
* you must provide your keystore password. *
***************** WARNING WARNING WARNING *****************
Alias name: androiddebugkey
Creation date: Mar 3, 2022
Entry type: PrivateKeyEntry
Which makes me think I do have a keystore....
I don't understand why the keystore becomes an invalid one as soon as I provide a password
Is there something I'm missing? Any shell I should be running this command from?
Sorry for the formatting, this is literally my first post on this forum.
Thanks
Daniele
Hi, @Daniele Della Cioppa What keystore do you get from the cmd? Is it like this: SHA1: BB:0D:AC:74:D3:21:E1:43:07:71:9B:62:90:AF:A1:66:6E:44:5D:75
? To get the key, try using the following code:
keytool.exe -list -v -keystore "C:\Users\[USERNAME]\AppData\Local\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
For more details, you could refer to: https://learn.microsoft.com/en-us/xamarin/android/platform/maps-and-location/maps/obtaining-a-google-maps-api-key?tabs=windows#obtaining-your-signing-key-fingerprint
I've substituted [USERNAME] with my username folder and still got the same error
C:\Users\danie>keytool.exe -list -v -keystore "C:\Users\danie\AppData\Local\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
keytool error: java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:666)
at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:57)
at sun.security.provider.KeyStoreDelegator.engineLoad(KeyStoreDelegator.java:224)
at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(JavaKeyStore.java:71)
at java.security.KeyStore.load(KeyStore.java:1445)
at sun.security.tools.keytool.Main.doCommands(Main.java:832)
at sun.security.tools.keytool.Main.run(Main.java:375)
at sun.security.tools.keytool.Main.main(Main.java:368)
any ideas?
I had the same error. The problem is in VS2022 version 17.0.5 (not sure about ubdates). If you generate a keystore through the Archive Manager, the keystore is generated but is invalid because the expiration date is not set in the keystore.
The solution for me was to generate the keystore in VS2019. I kept it installed on my machine.