google maps doesnt show after upload to google play

这一生的挚爱 提交于 2020-01-03 11:35:30

问题


I uploaded my app to the google play store, and the map didn't work, just showed white screen. I understand that I have to get a key based on the release certificate fingerprint. I have tried to read all about it, and have done the following, but it still isn't working:

I created a new keystore (with password, and alias and password etc) from Android Studio.

I run the cmd and did this:

keytool -list -v -keystore key.jls -alias MyPlaces

then put in my password, and got all the information that I need. I generated a key for google maps and places api, based on the sha1 fingerprint result that I got. I put in my package name. I put the Alias code back into my app for the key.

But it still doesn't work. I know others have had this problem, but what helped for them hasn't helped me.

Why? I hope its clear what i wrote. Thanks

I am not uploading it each time i check to the play store. Rather i create the signed apk, then try to run it from my phone. DOes this matter?

EDITED:

This is the message I get in the logs.

06-22 23:10:07.529 6500-6543/? E/b: Authentication failed on the server.

06-22 23:10:07.530 6500-6543/? E/Google Maps Android API: Authorization failure. Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.

06-22 23:10:07.536 6500-6543/? E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)

Ensure that the "Google Maps Android API v2" is enabled.

Ensure that the following Android Key exists:

API Key: YOUR_KEY_HERE

Android Application (;): 38:.......F0;com.....myplaces (I have deleted this for security)


回答1:


i solved this problem finally after 3 week :D

you upload the googleplay your apk, now you have 2 different " SHA-1 ", They are "Installation certificate (your old certificate code)" and "Application signing certificate(its the new, from the googleplay") enter image description here

you need to do so easy, you must add to api console your new SHA-1




回答2:


First check if you have debug and release app keys. Then you have to link your api to your proyect. Apis and services (google play console). So You have to configure google play services because google maps api uses it.

I know there are diferent keys for debug and released apps. i recomend API v3 too.

Try this to register your api key.

https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=24:85:5A:C0:F8:0D:36:4C:1A:B9:45:B6:21:92:B0:6E:7D:71:55:08%3Bcom.mapsapi.vatsan.googlemapsapidemo It can take some minutes. Then you have to set your google_maps_key in your android app Manifiest.

<meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIzaSDSSDDDAAD...Your API KEY" />

If doesnt work and if you are using android studio, try creating a new Map Activity(It's V3), complete res/values/google_maps_api.xml with the key and the map gonna work. How to create google map

I can use googlemaps in my app after upload it to google play store. You have to configure Google Play Services in your google play console.




回答3:


This is the answer.

In my log it showed:

API Key: YOUR_KEY_HERE

Google automatically makes a resource file, googles_maps_api.xml and in there the string reference:

<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIza....DOWdQ</string>

When compiled, it wan't identifying this string. I made a string resource in the strings.xml file, and then it worked.




回答4:


Consider trying this approach:

  • First, I see you have done some of the steps as described in the developer documentation.
  • You should however, add a second key for the debug to the project you created on the developer console.
  • For some reason, without both, sometimes it fails to show the map when you publish.
  • I also switched from using v2 to geo when adding to your AndroidManifest file.

Of course you must add the INTERNET PERMISSION and if you are using Gradle dependency manager, add the google-play-services from your sdk.

compile 'com.google.android.gms:play-services-maps:9.0.2'

I hope this helps! Let me know how it goes!



来源:https://stackoverflow.com/questions/37976365/google-maps-doesnt-show-after-upload-to-google-play

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!