The published application on the Play Store does not support communication with the Google Maps API and Facebook API

I created a signed APK with Android Studio, and I added my SHA1 fingerprint and relative api keys in my application to the Google Developer console and Facebook console. Everything works well if I download a signed apk via usb, after installing its api map and facebook api work fine. If I upload the same apk to the Play Store when I try to log in to Facebook, it says "invalid key hash. Hash blablabla key does not match any saved." Therefore, if I sign up without facebook, I can’t even get my Google maps; it makes me think that the apk downloaded to the game store changes its fingerprint or something like that. I checked all things in Android Developers and Stackoverflow, but I can not get it to work, because the stock problem is that this signed apk package works well until I upload it to the Play Store.

+9
source share
7 answers

I finally decided that the problem was that the google_maps_api.xml file provided by the api was not uploaded to the release, so I

I like it:

buildTypes { debug { manifestPlaceholders = [mapsKey: "AIzaSyB8o9KzQ5YN8U8AFS************"] } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' manifestPlaceholders = [mapsKey: "AIzaSyApLacqgkdIR7uEpcf*****************"] } } 

and then in my AndroidManifest

 <meta-data android:name="com.google.android.geo.API_KEY" android:value="${mapsKey}" /> 

Link: fooobar.com/questions/1270666 / ...

then I registered 2 different keys, each of which has the correct sha1 fingerprint, one debug and the other specified by the Google Play console (not a download certificate, but another created by Google).

Thanks very much to Zuhad and Andy Developer for the inspiration.

+1
source

Here is the answer why you don’t see a Google map.

I recently posted an APK on the Google Play store, and I ran into the same issue after checking out the Play Console. I found a solution to this problem.

They have no problem with your key, but a problem with your SHA-1. You signed your APK with your SHA-1, which is fine, and then download the APK, it’s also great.

But according to the new Play Console update, when you signed the APK with SHA-1 and downloaded the APK, it was signed only by you, but according to the new update, it also signed the Google Play for more security. Check out part of the Google Play section here:

With a subscription to the Google Play App: you sign your application using your boot key. Google then verifies and removes the signature of the download signature. In conclusion, Google re-signs the application using the original signature key of the application that you provided and delivers your application to the user.

You can link the documentation here.

Now the answer to your question: After successfully loading the APK, you can see that in the section with two SHA-1s of the 1st SHA-1, Google created its own and the second SHA-1 is yours .

So, just copy Google SHA-1 and paste it into the console, where you create the Google map API key.

+24
source

With inspiration from @Andy Developer, I was able to display the map after the application was uploaded to Google Play. These were the following steps:

  • Download the app on Google Play (signed APK file)
  • After the application has been submitted and approved, select your application from the Google Play Console
  • Go to development tools β†’ Version Control β†’ Application Signing

Register apps on the Google Play console

  1. Copy the first SHA-1 certificate that Google Play issued after downloading the application.
  2. Go to the Google Console and select your project.
  3. Select your API key, restrict your key and insert SHA-1 after the package name.

Paste SHA-1 into Google Console

  1. Click "Save", wait a couple of minutes. and your app should show Google Maps.
+18
source

The types of debug and release builds of your application are signed with two different keys.

You need to register both keys in Google Maps and Facebook for their access to their services.

0
source

Yes, it’s obvious that the card will not load in the signed APK.

Decision:

When you create an API key in the Google API console, you need to restrict the key with the SHA key

But after creating the Signed APk, you need to take the release mode SHA key and add the API API to the console for enter image description here

I attached the image, look

hope this helps.

0
source

For Facebook to generate a hash key, use the code below:

 try { PackageInfo info = getPackageManager().getPackageInfo( "YOUR PACKAGE NAME", PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); } } catch (PackageManager.NameNotFoundException e) { } catch (NoSuchAlgorithmException e) { } 

Once you get the hash code, paste it into the Facebook Developer Console and go ahead

hope this helps :)

0
source

Sorry, but I do not see the KEY API here ?? Please, how can I associate the KEY API with Oauth client ids ??

enter image description here

0
source

Source: https://habr.com/ru/post/1270658/


All Articles