Google Places for android not working for release apk, only works for debug apk even though I added both SHA1 certificate fingerprint for both debug key and for release key. I don't know what is wrong this is how I got release key sha1 fingerprint keytool -list -v -keystore releasekey.jks -alias aliasForKey
and entered correct password then got correct output with no errors Certificate fingerprints:
MD5: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:
SHA1: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:
SHA256: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:
Asked
Active
Viewed 167 times
0

Phantômaxx
- 37,901
- 21
- 84
- 115

Richard K Maleho
- 436
- 6
- 16
-
1Possible duplicate of [Google Places for Android API key does not work on app from Play Store](https://stackoverflow.com/questions/51159372/google-places-for-android-api-key-does-not-work-on-app-from-play-store) – Tim Biegeleisen Sep 18 '18 at 11:07
-
1The thing to realize here is that when you publish your app to the Play Store, Google removes your signature and then resigns it. The SHA1 hash you need to use has to come from the Play Store console, _not_ from your local call to `keytool`. – Tim Biegeleisen Sep 18 '18 at 11:08
-
Actually, I don't know why but you have to use the SHA256 Key available in the playstore developer console. With this one, your Google API will work. – Maxouille Sep 18 '18 at 11:56
-
@Maxouille can I use the SHA256 key I got from `Keytool` – Richard K Maleho Sep 18 '18 at 12:07
-
@TimBiegeleisen I did not yet upload app to play store, I just singed it using release key but it still don't work – Richard K Maleho Sep 18 '18 at 12:08
-
@Maxouille I tried using SHA256 but Google places console wont allow me to add it because it is invalid key, I get this error `Invalid SHA-1 certificate fingerprint` – Richard K Maleho Sep 18 '18 at 12:13
-
It's such a mess these key for google api ... In Android Studio, you have to use a SHA256 key, not a SHA1 as far as I remember. – Maxouille Sep 18 '18 at 12:25
1 Answers
1
If minifyEnabled is true, then paste these line in your proguard-rules.pro file
-keepnames class * implements java.io.Serializable
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
!static !transient <fields>;
!private <fields>;
!private <methods>;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}

Rahul Singh Chandrabhan
- 2,531
- 5
- 22
- 33