Google Maps V2 shows blank screen on android 2.2
Asked Answered
P

5

11

I tried following a tutorial on Android Maps V2 Quick Start But when I run the app, a blank map screen is shown. My phone uses android 2.2.1.

enter image description here

This is what shows in logcat:

12-07 18:07:52.479: W/dalvikvm(1654): VFY: unable to resolve instance field 24
12-07 18:07:53.129: W/dalvikvm(1654): Unable to resolve superclass of Lmaps/a/du; (411)
12-07 18:07:53.129: W/dalvikvm(1654): Link of class 'Lmaps/a/du;' failed
12-07 18:07:53.139: W/dalvikvm(1654): Unable to resolve superclass of Lmaps/a/ej; (2363)
12-07 18:07:53.139: W/dalvikvm(1654): Link of class 'Lmaps/a/ej;' failed
12-07 18:07:53.139: W/dalvikvm(1654): Unable to resolve superclass of Lmaps/j/k; (2379)
12-07 18:07:53.139: W/dalvikvm(1654): Link of class 'Lmaps/j/k;' failed
12-07 18:07:53.149: E/dalvikvm(1654): Could not find class 'maps.j.k', referenced from method maps.y.ae.a
12-07 18:07:53.149: W/dalvikvm(1654): VFY: unable to resolve new-instance 3571 (Lmaps/j/k;) in Lmaps/y/ae;
12-07 18:07:53.389: W/dalvikvm(1654): VFY: unable to resolve direct method 14965: Ljava/io/IOException;.<init> (Ljava/lang/String;Ljava/lang/Throwable;)V

Edit: This is the manifest.xml file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.eunice.mapstry"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />
    <uses-feature android:glEsVersion="0x00020000" android:required="true"/>
    <permission android:name="com.eunice.mapstry.permission.MAPS_RECEIVE"
                android:protectionLevel="signature"/>
    <uses-permission android:name="com.eunice.mapstry.permission.MAPS_RECEIVE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>


    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <uses-library android:name="com.google.android.maps" />

        <activity
            android:name="com.eunice.mapstry.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyBt_JE6_XIVR8-t0HrbhskeLrAVxSJst6c"/>
    </application>

</manifest>

Edit: I have added an image of my google api console:

enter image description here

Parasite answered 7/12, 2012 at 18:12 Comment(6)
Have you added an API Key of your own creation?Robbery
Yes I have. I first created one with the debug keystore. When that one did not work out, I created a different keystore and created an api key with that one but it still doesn't workParasite
The map view is there so the only 2 things I know to stop the map appearing are a bad key or you haven't added the permission to access the internet in the manifest.Robbery
@GrahamSmith I just added the manifest.xml. I have added all the required permissions and a valid api key.Parasite
i face the same problem but i can't solve it..can u help me?Wolpert
@Akhil, mine was because I was using the wrong keystore. Have you checked to make sure you are using the correct keystore.Parasite
P
7

I finally found out what the problem was. I was picking the wrong debug keystore. I am working with an ubuntu machine. Since I opened eclipse as root, the default keystore in eclipse was located in my root folder(/root/.android/.android/debug.keystore) whiles I was creating the api key with the debug keystore from my user folder. I created a new api key with the debug keystore in the root folder and it works now.

Parasite answered 11/12, 2012 at 9:34 Comment(0)
S
2

make sure that you enable the Google Maps Android API v2 service in the https://code.google.com/apis/console

  1. Go to you https://code.google.com/apis/console-> services tab
  2. Make sure Google Maps Android API v2 is ON
  3. Go to API Access tab
  4. Create again a new Android key

Then you're good to go :)

Sat answered 10/12, 2012 at 15:42 Comment(1)
I already did that. I have just edited my question to include an image of my google apis console.Parasite
V
1

I was mucking around with this stuff for ages as well (certificates, package names, API console etc.) and nothing worked until I tried uninstalling the app from my device, then re-installing it and suddenly it was fine.

Victoria answered 10/2, 2013 at 9:5 Comment(0)
S
1

I had the same problem but solved it like that. Might be helpful if the above answer doesn't work for you. After I changed my app's package name, map starts not to show up. (it happened after I changed my package name)

  1. Delete the keystore file that you used for previous package
  2. Create a new keystore file
  3. Get SHA1 fingerprint
  4. Go to API Console
  5. Create a new Android App.
  6. Paste your fingerprint
  7. Use the given API Key in your Manifest File

That worked for me

Selfloading answered 25/7, 2013 at 13:55 Comment(0)
A
0

I had the same issue and the solution was to delete the debug.keystore. Then i did an adb uninstall com.example.myapp Then clean and run the application again.

I think the problem was due to the fact that i copied and pasted in my manifest a dummy API key and I first deployed the application with it.

Aged answered 19/7, 2013 at 8:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.