Skip to content Skip to sidebar Skip to footer

Can't Get Map With Google Map API V2

I'm trying to get a simple map on my app by using Google Map API V2; I followed all the steps to do it but when I launch my app, I only get white page with a Google logo in the lef

Solution 1:

I don't see anything wrong with your code. The symptom you decribe point to a not valid api key or gps is turned off, or even your are running this is an emulator with no google play installed. Check what google play versions is installed and used under build.gradle. eg:

dependencies { compile 'com.google.android.gms:play-services:6.5.87'

I suggest you post your debuger log, if it is an api error it will state it there.


Solution 2:

I suspect 3 things wrong in your code :

(1) Declare permission before using it :

    <permission android:name="com.example.ismail.location_test.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
    <!-- after declare use this -->
    <uses-permission android:name="com.example.ismail.location_test.permission.MAPS_RECEIVE"/>

(2) Missing Declare gms version variable :

  <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

(3) Missing declare API_KEY :

<meta-data
    android:name="com.google.android.maps.v2.API_KEY"
    android:value="AIzaS33yBBDxSDFsdf33BK-7HCasdfSADFfa72wJnKLZvq6A" />

Please check with above 3 suspects first : then if still error is there you can re-confirm steps to enable Google Maps from here


Post a Comment for "Can't Get Map With Google Map API V2"