Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps on Android shows grey screen

I had this issue before, where Google Maps shows grey screen and no maps displayed.

I fixed this issue by installing google services on the test environment and it works fine.

The problem now is that the published app is showing the same grey screen (No maps) for people who installed the app from Google Play.

I cant ask people to go and download Google Services so they get my app working.

Is there anyway I can embed these services into my app or any other way to fix this issue.

Thanks

I have this in google_maps_api.xml

 <string name="google_maps_key" translatable="false" templateMergeStrategy="preserve">
     AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 </string>

I also have this in the manifest

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="@string/google_maps_key" />
like image 238
Ken Avatar asked Dec 24 '22 19:12

Ken


1 Answers

Do you have following:

Add the Google Play services version to your app's manifest

Edit your application's AndroidManifest.xml file, and add the following declaration within the element. This embeds the version of Google Play services that the app was compiled with.

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
like image 188
Xcihnegn Avatar answered Jan 08 '23 04:01

Xcihnegn