I've created an Android project using Xamarin platform on Visual studio and uploaded it to app store. But now for some reasons I have to switch to Android Studio for the same app, I already have keystore on Xamarin. how can I import keystore in my Android Project.
-
Just to confirm. Are you using MacOS or Windows? – arvicxyz Aug 13 '18 at 12:08
-
I'm using windows – Yasir Ghafar Aug 13 '18 at 12:24
1 Answers
Windows
For Debug Builds
Locate the Xamarin debug.keystore file that is used to sign the app. By default, the keystore that is used to sign debug versions of a Xamarin.Android application can be found at the following location:
C:\Users\USERNAME\AppData\Local\Xamarin\Mono for Android\debug.keystore
Information about a keystore is obtained by running the keytool.exe command from the JDK. This tool is typically found in the following location:
C:\Program Files (x86)\Java\jdkVERSION\bin\keytool.exe
Add the directory containing keytool.exe to the PATH environment variable. Open a Command Prompt and run keytool.exe using the following command:
keytool.exe -list -v -keystore "%LocalAppData%\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
When run, keytool.exe should output the following text. The MD5: and SHA1: labels identify the respective signatures:
Alias name: androiddebugkey
Creation date: Aug 19, 2014
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 53f3b126
Valid from: Tue Aug 19 13:18:46 PDT 2014 until: Sun Nov 15 12:18:46 PST 2043
Certificate fingerprints:
MD5: 27:78:7C:31:64:C2:79:C6:ED:E5:80:51:33:9C:03:57
SHA1: 00:E5:8B:DA:29:49:9D:FC:1D:DA:E7:EE:EE:1A:8A:C7:85:E7:31:23
SHA256: 21:0D:73:90:1D:D6:3D:AB:4C:80:4E:C4:A9:CB:97:FF:34:DD:B4:42:FC:
08:13:E0:49:51:65:A6:7C:7C:90:45
Signature algorithm name: SHA1withRSA
Version: 3
For Release / Custom Signed Builds
The process for release builds that are signed with a custom .keystore file are the same as above, with the release .keystore file replacing the debug.keystore file that is used by Xamarin.Android. Replace your own values for the keystore password, and alias name from when the release keystore file was created.
When the Visual Studio Distribute wizard is used to sign a Xamarin.Android app, the resulting keystore resides in the following location:
C:\Users\USERNAME\AppData\Local\Xamarin\Mono for Android\alias\alias.keystore
For example, if you followed the steps in Create a Create a New Certificate to create a new signing key, the resulting example keystore resides in the following location:
C:\Users\USERNAME\AppData\Local\Xamarin\Mono for Android\chimp\chimp.keystore
For more information about signing a Xamarin.Android app, see Signing the Android Application Package.
Click here for the full reference
Once you've got the keystore from Xamarin then you can just simply import it by following these instructions.
This is specified in your Gradle build file, copy the keystore file into your Android Studio project structure, I chose to create a new directory under app called keystores: /app/keystores/release.keystore
signingConfigs {
debug {
storeFile file('keystores/debug.keystore')
}
release {
storeFile file('keystores/release.keystore')
keyAlias ...
storePassword ...
keyPassword ...
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
debuggable true
}
release {
signingConfig signingConfigs.release
debuggable false
}
}
- 381
- 3
- 13