0

2 days ago I published my app but It doesn't work . It doesn't load map with Google Maps API (Last version), I can see only white screen with google written in left-bottom position, and doesn't load Google Places API Research bar.

I've tried xomena advice but it doesn't work. LogCat say me :

03-29 09:22:39.807 8728-8815/? 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. 03-29 09:22:39.812 8728-8815/? 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 (;): Here SHA1 fingerprint from Play Store

Google Maps Android API v2 are enable, The fingerprint is correct and the key exists . I've tried to copy the Fingerprint in LogCat too but nothing.

I solved it . For other with the same problem, I've forgotten to modify key value on projectname/app/src/release/res/values .

  • Given that searching on this site will give you a few suggestions, what have you tried, were you able to see the map when you side-loaded your release apk to a clean device, check what key you use to release, etc. – Morrison Chang Mar 28 '18 at 20:39
  • I've tried to search on stack but I don't understand what's the problem and I haven't found recent similar resource... – Federico Pennino Mar 28 '18 at 20:49
  • 1
    The least you can do is [edit](https://stackoverflow.com/posts/49543659/edit) your post with what have you tried and what logcat output you found. Saying "it doesn't work" or "I can't find anything" doesn't help anyone. What if anything is in the logcat of the published app? Did you compare the app to the pre-uploaded signed app and the one in the Play Store? – Morrison Chang Mar 28 '18 at 21:05
  • Have you seen this answer: https://stackoverflow.com/a/44672565/5140781? – xomena Mar 28 '18 at 21:11

2 Answers2

1

Map api needs sha1 and package name to register app on google developer console

Firslty when our app is in under development then we put debug sha1 then it display map on our app.

After Publish our app we have to add sha1 of release apk. So please update sha1 of release apk to google developer console that will solve your problem. And map will appear.

chetan prajapat
  • 311
  • 1
  • 9
0

you have to verify your maps_api_key from google, other wise you can't get access to maps. that why your getting white map with google logo. below code help you to verify your maps_api_key from google.

 protected synchronized void buildGoogleApiClient() {
    System.out.println("buildGoogleApiClient");
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(LocationServices.API)
            .build();
    mGoogleApiClient.connect();
}

call this method from onMapReady() method. by checking internet availability at that time, like below

  public void onMapReady(GoogleMap googleMap) {
    if (!Utils.isNetworkAvailable(this)) {
        Toast.makeText(this, "No Internet Connection! Try Again later", Toast.LENGTH_LONG).show();
    } else { 
          //Initialize Google Play Services
            buildGoogleApiClient();`
 }
Mohd Qasim
  • 896
  • 9
  • 20