xamarin -keystore and apk have sha1 is different - android

I have old Xamarin android project. I made small changes and changed target to android x. The customer sent me a keystore file with password and alias. Now I need to sign and publish the package in google play. But I am getting the error your fingerprint does not match:
-need "Sha1Need"
-current "Sha1Other"
I check my key file with command:
keytool -list -v -keystore "my.keystore" -alias key -storepass mypass -keypass mypass
I get result value "Sha1Need".
Than I checking my apk with command:
keytool -printcert -jarfile my.apk
I get value "Sha1Other". How is it possible? And how can I fix this?
I use this code in my .csprj file:
<AndroidSigningKeyStore>app.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>mypass</AndroidSigningStorePass>
<AndroidSigningKeyAlias>alias</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>mypass</AndroidSigningKeyPass>
--UPDATED--
This was a problem on the customer's side. He changed the password on the key several times, and one of the options worked.

Related

Android Cannot recover key

I'm having an error recovering my key in Android Studio.
I know the key alias and I have the correct password for both.
I know this because I am able to run: keytool -list -v -keystore mykeystore.jks -alias myKey -storepass myPass -keypass myPass
in cmd and get my certs.
My storepass and keypass are the same and I copied and pasted all of the values from cmd to android studio, but I still get this error.
I've also tried restarting android studio and manually retyping my passwords and alias multiple times to no avail.

Google Maps Api don't work when uploaded

My application does not work when I upload it to the play store. It works fine when installing it from android studio.
Is there something special that's need to be done with the api key?
In windows this would be the command to get SHA1 key
Open a terminal window.
​
cd C:\Program Files\Java\jdk1.7.0_05\bin
Next we have to run the keytool.exe. Use the following line to get the Android SHA1 fingerprint.
​(PRODUCTION KEYSTORE) keytool -exportcert -alias keystore -keystore "C:\Users\myusername\Documents\AndroidKeystore\androidkestore.jks" -list -v​
​(DEBUG KEYSTORE:)​
keytool -list -v -keystore "%USERPROFILE%.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android​
Note the third point where keystore for production is retrieved. You need to add this value into your developer console as shown below
Go to your Google Api Console -->> Select your Project --> Go to Credential --> Click on Api key you generated.
Here you can check the packageName And your SHA 1 check if eveythign is proper.(you have submitted correct SHA1)
And It should work.

Cannot see google maps on android when I upload it for release (works in debug), trying to get SHA1 from my created keystore

(Mac)
I created a keystore with alias and password with the same name (projectOne) and when I try to get the SHA1 from that created keystore and put it on my created google console maps I have trouble getting the SHA1 out.
I type this in the terminal but it does not let me access the keystore.
keytool -list -v -keystore ~/.android/ projectOne.keystore -alias projectOne
It says this (roughly translated):
Invalid option/Unauthorized: projectOne.keystore
Now I use the SHA for debug:
keytool -list -v -keystore ~/.local/share/Xamarin/Mono\ for\ Android/debug.keystore -alias androiddebugkey -storepass android -keypass android
And this does not work when I try to "release" it. So I assume I have to get the SHA1 from my own created keystore but as I mentioned above. It says it is an invalid option/Unauthorized option.
Based from this documentation you need to first find the .keystore file that your .apk was signed with. The keystore used will depend on if your app's .apk package was created as a debug build, or if it was packaged with a different .keystore file.
For builds that you have signed with your projectOne.keystore file, you need to substitute your own values for the .keystore file, keystore password, and alias name from when you created the keystore file.
You can follow these tutorial and forum which suggested to verify that the alias or password you use is correct.

Android: Released vs Debug Fingerprint (Sha1)

I was trying to obtain my Sha1 fingerprint for release and debug. Fortunately, I was able to obtain the debug version code through
keytool -list -alias androiddebugkey -keystore C:\Users\Name.android\debug.keystore -storepass android -keypass android
I was wondering how I would get the release? I tried
keytool -list -alias androidreleasekey -keystore C:\Users\Name.android\debug.keystore -storepass android -keypass android
but unfortunately it came out as keytool error: java.lang.Exception: Alias <androidreleasekey> does not exist.
*Actually my result may have been my released key store since I already built it as released app... I'm not entirely sure though.
You need to find the location of the release keystore file and the name of the alias that you used to build your app.
To do this in Android Studio select Build > Generate Signed APK. You should see a dialog similar to below.
Get the location of the full file path for the release keystore from the Key store path. Then use this path along with the Key alias that is listed to get the SHA1 as you tried previously:
keytool -list -alias myappsalias -keystore
C:\users\dell-laptop\AndroidStudioProjects\myapp\myapp_release.keystore -storepass android -keypass android

Google map reporting invalid key in Android

I got the SHA-1 fingerprint from using the keytool for my application on my key that I sign the application with when I upload it to the play store.
But when I open the app on my phone for testing it says it is not the right key. ANy ideas what I could be doing wrong?
Not sure what more information i can give without giving security info for my app, so if you can help give me anymore information that I can not think of please let me help you help me.
First for the development generate a SHA-1 from debug.keystore:
Navigate to C:\Program Files\Java\jdk1.6.0\bin>..... where your bin located then execute below command
C:\Program Files\Java\jdk1.6.0\bin>keytool -v -list -alias androiddebugkey -keystore "D
:debug.keystore" -storepass android -keypass android
or
C:\Program Files\Java\jdk1.6.0\bin>keytool -v -list -alias androiddebugkey -keystore "C:\Documents and Settings\user1\.android\debug.keystore" -storepass android -keypass android
Now, you can get one SHA-1 certificate and generate API key from Google API console. Add this key into your manifest.xml file. remember this API key only for the development. Using this key built apk u can not publish into market.
Now, turn to make your own keystore: execute below command
C:\Program Files\Java\jdk1.6.0\bin>keytool -genkey -v -keystore OWN.keystor
e -alias ALIASNAME -keyalg RSA -keysize 2048 -validity 300000
and give all the required details for this keystore. Now time to generate SHA-1 from your OWN.keystore execute below commnad
C:\Program Files\Java\jdk1.6.0\bin>keytool -v -list -alias ALIASNAME -keystore "C:\Program Files\Java\jdk1.6.0\bin\OWN.keystore" -storepass PASSWORD -keypass KEYPASSWORD
Now, you can get one SHA-1 certificate and generate API key from Google API console. Replace this key into your manifest.xml file. Now your app is ready to publish into market.
This may helpful to you.
Have you tried to completely remove the application and then install it all over again. This key might be got cached and even if you install the application with new key.
So before you install your application with the new key, try to remove the application completely from the phone.
You can as well go over this blog post I wrote and make sure you do all the steps right in producing the key:
Google Maps API V2 Key

Categories

Resources