10

I am having trouble importing an existing keystore to Visual Studio 2017 (15.7.2) in order to sign my Xamarin.Android application.

I switched machines, so I had to do a fresh VS installation. I have successfully created an archive, but I can't get my old keystore imported into VS. No matter what I try, I get the same cryptic error. I can sign the APK manually with the keytool, so it's not about a wrong password.

Deeq
  • 103
  • 1
  • 5

1 Answers1

8

From this path in your old machine Copy the folder Keystore in the same path in your new machine: %LOCALAPPDATA%\Xamarin\Mono for Android

Jack
  • 871
  • 1
  • 9
  • 17
VahidShir
  • 2,066
  • 2
  • 17
  • 27
  • 3
    I copied the key folder from this location to the exact same location in the new machine, restarted Visual Studio and the key was visible. Still, this does not explain why I can't successfully import the actual keystore that contained the original key to VS on the new machine. – Deeq May 28 '18 at 10:43
  • Yes, and now you can easily sign your app with this key which is exactly the same key on original machine. – VahidShir May 28 '18 at 10:46
  • I tried to upload the APK to Play Console, and received an error that the upload cert was incorrect. I manually signed the APK with the apksigner tool, and the APK was correctly signed. Your suggestion didn't quite work as intended, as I can't sign the APK straight from Visual Studio. – Deeq May 28 '18 at 11:11
  • Your two solutions must be exactly same on both machines which it makes sure that essential app information such as package name among others in AndroisManifest is exactly the same. – VahidShir May 28 '18 at 11:14
  • I use Git, so the solutions are identical. I tried to import the keystore from the location you suggested, but Visual Studio still incorrectly signs the APK. When I do it myself manually with the keystore from the location you suggested, the APK is signed with the right fingerprint, and is accepted by Play Console. – Deeq May 28 '18 at 11:28
  • Install both apps(signed with two mentioned keys) on a device, check to see that does second app updates the first one or there would be two identical apps installed alongside each other? – VahidShir May 28 '18 at 13:07
  • you need to restart visual studio even if you had an error, error will disappear after raster the visual studio and key store will be visible – Mohamad Mahmoud Darwish Nov 20 '21 at 18:16