Plz HELP!! Google Maps still display a GREY GRID in Android Emulator


Last Updated:

  1. hakerjack

    hakerjack Member This Topic's Starter

    Joined:
    Oct 24, 2010
    Messages:
    6
    Likes Received:
    0
    So I've read dozens of similar post on the web but none of them solve my problem. I just simply followed the tutorial on Android official website that creating a GoogleMap view, but I failed to display the map in the emulator but grey grids and blocks instead. I'm using my own Google API key in this case; the zoom function works fine, just I can't get the real map data through my code.

    The following are my code and I highlight the lines you might think are essential for working correctly in this case.

    main.xml
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <com.google.android.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:enabled="true"
    android:clickable="true"
    android:apiKey="0IX_ldMXFYCnjfT6q6CTGLcjvij7PsIX_E3ZW8A"
    />
    </RelativeLayout>


    AndroidMainfest.xml
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="net.learn2develop.GoogleMaps"
    android:versionCode="1"
    android:versionName="1.0">
    <application android:icon="@drawable/icon" android:label="@string/app_name">

    <uses-library android:name="com.google.android.maps" />

    <activity android:name=".MapsActivity"
    android:label="@string/app_name">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>

    </application>

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />


    </manifest>


    MapsActivity.java
    package net.learn2develop.GoogleMaps;

    import android.os.Bundle;

    import com.google.android.maps.MapActivity;
    import com.google.android.maps.MapView;


    public class MapsActivity extends MapActivity {
    /** Called when the activity is first created. */

    MapView mapView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    mapView = (MapView) findViewById(R.id.mapView);
    mapView.setBuiltInZoomControls(true);

    }

    @Override
    protected boolean isRouteDisplayed() {
    return false;
    }

    }

    I found the default debug keystore eclipse is using is the one being auto-generated, not the one I used for acquiring my API key. Is that might be the problem?

    Anyone who runs into the same problem before please helps me out!
     

    Advertisement
  2. dioni87

    dioni87 Member

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    Try to generate the md5 by keytool from your java jdk...
    run cmd->keytool
    -list -alias androiddebugkey -keystore "Location of the keystore" -storepass android -keypass android

    My friend have the same problem with u because he wrong inserting api key...

    Hope this help u bro
     
  3. hakerjack

    hakerjack Member This Topic's Starter

    Joined:
    Oct 24, 2010
    Messages:
    6
    Likes Received:
    0
    Hi dioni87, I believe I did generate the md5 by using the keytool under java/jdk***/bin folder, and I have my keystore file ("which named ".keystore" by default) located under my workspace folder. Is that a matter of where you keep your keystore file at?

    Also could you explain those command at above you suggested me to type in? I'm not really good at command prompt...

    Thanks!
     
  4. dioni87

    dioni87 Member

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    the command above explains how to retrieve md5 fingerprint from cmd...use command under keytool...

    i'm copy the keystore from .android folder to C:\android to simplify the writing in the command prompt.

    Can you explain me how do you get the md5 certificate?
    Im also working on a map...
     
  5. dioni87

    dioni87 Member

    Joined:
    Oct 17, 2010
    Messages:
    11
    Likes Received:
    0
    My friend is also experiencing the same problem with you, and I told him to repeat the decision-md5 fingerprint with the way above, and the result map appears.

    If the application runs well on emulator but it does not appear on the map means the map was not referring to the google well ...

    sorry if my language a bit difficult to understand
     
  6. hakerjack

    hakerjack Member This Topic's Starter

    Joined:
    Oct 24, 2010
    Messages:
    6
    Likes Received:
    0
    Thanks, I can understand, and I solved the problem by using the Google debug key and it worked. Since I design my application for the research and won't go for release it is fine for me to use the debug key. I'll probably try the way you suggested some day. Thank you!:)
     
  7. Kalthasar

    Kalthasar New Member

    Joined:
    Nov 3, 2010
    Messages:
    3
    Likes Received:
    0
    I had the same problem just now, and also fixed it by switching to using a debug certificate.

    Anyway, I've gone through the rest of that tutorial, and I can't get the overlay objects that are created in that tutorial to display. Any ideas?
     
  8. yumison

    yumison New Member

    Joined:
    May 9, 2011
    Messages:
    1
    Likes Received:
    0
    i had it ,too.
    this is my cmd prompt&#65306;c:\Program Files\Java\jdk1.6.0_24\bin>keytool -list -alias androiddebugkey -keystore "C:\Users\y\.android\debug.keystore" -storepass android -keypass android
    i also got the fingerprint(md5) and went to the website (which is asking for Android Maps API Key) to receive the api key.
    but it still appers grid without the map!!!
    Does anyone know how to let the map appear?i'm so confused about it. thank you!
     
  9. stevetiger

    stevetiger New Member

    Joined:
    Mar 8, 2012
    Messages:
    1
    Likes Received:
    0
    I just spend 5 hours on this and still couldn't figure out the problem. I generated 4 different keystore and still see empty grid.

    I just wonder where should I put the keystore at?
    What is debug key? I just want to see the sample app to work.

    Thanks,

    Steve
     

Share This Page

Loading...