5

I did al procedure to add google maps api but i am getting this errors. Sorry for bad language.

09 12:20:55.359: W/dalvikvm(5918): Unable to resolve superclass of Lmaps/a/du; (406)
01-09 12:20:55.359: W/dalvikvm(5918): Link of class 'Lmaps/a/du;' failed
01-09 12:20:55.359: W/dalvikvm(5918): Unable to resolve superclass of Lmaps/a/ej; (2358)
01-09 12:20:55.359: W/dalvikvm(5918): Link of class 'Lmaps/a/ej;' failed
01-09 12:20:55.359: W/dalvikvm(5918): Unable to resolve superclass of Lmaps/j/k; (2374)
01-09 12:20:55.359: W/dalvikvm(5918): Link of class 'Lmaps/j/k;' failed
01-09 12:20:55.359: E/dalvikvm(5918): Could not find class 'maps.j.k', referenced from method maps.y.ae.a
01-09 12:20:55.359: W/dalvikvm(5918): VFY: unable to resolve new-instance 3566 (Lmaps/j/k;) in Lmaps/y/ae;

Here its the manifest.xml

 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
 <uses-permission android:name="android.permission.INTERNET" />
 <uses-permission android:name="android.permission.READ_PHONE_STATE" />
 <uses-permission android:name="com.comparto.piso.permission.MAPS_RECEIVE" />
 <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" />

 <permission
        android:name="com.comparto.piso.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

       <application
              ........ >
            <uses-library android:name="com.google.android.maps" />
   <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="api key" />
    ......
    .....

In java code i extends FragmentActivity and here its the onCreate code

GooglePlayServicesUtil
                .isGooglePlayServicesAvailable(getApplicationContext());

        GoogleMap map = ((SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map)).getMap();
        if (map != null) {
            map.setMapType(GoogleMap.MAP_TYPE_NORMAL);
        }

here its the layout xml

 <fragment
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/map"
                android:layout_width="fill_parent"
                android:layout_height="300px"
                class="com.google.android.gms.maps.SupportMapFragment" />
Damian SIlvera
  • 866
  • 1
  • 9
  • 19

6 Answers6

5

All the "Unable to resolve superclass xxxx" and "Link of class xxxx failed" from Dalvik in the logcat is normal if your device is not on the same API level as the one used by the Google Maps library.

You should check whether you are getting an authorization failure instead by using this command:

adb logcat | grep Maps

If you see something like this:

E/Google Maps Android API(): Authorization failure.

Then it would mean that you are not supplying the correct API key in your manifest. Check again in your Google API Console (in the API Access section) whether you have added the correct fingerprint and package name pair as described in the guide.

Joe
  • 14,039
  • 2
  • 39
  • 49
2

I had same white screen issue after a little resaerch I find out I had forgot to enable map APi from developer console as shown in pic below :-

I hope you might have same problem and it will help :-

Map api enable on console

Hitesh Sahu
  • 41,955
  • 17
  • 205
  • 154
1

That error message usally occurs when running on a device that does not have Google Play APIs available. You call isGooglePlayServicesAvailable(), but you are not checking the return value. You should check to make sure it returns ConnectionResult.SUCCESS before proceeding. In the case of some other error codes, you can have them prompted to upgrade/install via getErrorDialog(), like --

int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
switch (resultCode) {
   case ConnectionResult.SUCCESS: // proceed
      break;
    case ConnectionResult.SERVICE_MISSING:
    case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED:
    case ConnectionResult.SERVICE_DISABLED:
          Dialog dialog = GooglePlayServicesUtil.getErrorDialog(resultCode, this, 1);
          dialog.show();
 }

According to Google, Google Play services API's require 'physical development device', so they are not officially supported on the emulators. So, if you are running on an emulator, it is almost certain you are missing the required services. People report getting it to work in emulators, but I have not tried myself. You can view than answers in this post, if you want to look at installing Google Play on an emulator.

Community
  • 1
  • 1
iagreen
  • 31,470
  • 8
  • 76
  • 90
  • i'm running the test in a real device and getting success. The error in logcat is: Could not find class 'maps.j.k', referenced from method maps.y.ae.a – Damian SIlvera Jan 14 '13 at 16:04
  • Okay. Do you have [Google Maps](https://play.google.com/store/apps/details?id=com.google.android.apps.maps&hl=en) installed and updated? Look at the beginning of your log trace and see if you see something like `E/Google Maps Android API(14657): Google Maps application is missing.` – iagreen Jan 14 '13 at 16:25
  • See [this answer](http://stackoverflow.com/a/13789869) for how to check programmatically in your app. – iagreen Jan 14 '13 at 16:35
  • it seems to be all installed, This is what i get in the fragment tag http://postimage.org/image/y21oak6jf/ – Damian SIlvera Jan 14 '13 at 16:57
  • okay, than my only other advice is to check to make sure you added your debug and release keys properly in the Google API Console, and that you enabled Google Maps Android v2, and not accidentally just Google Maps v2 – iagreen Jan 14 '13 at 17:45
0

If you use "class="com.google.android.gms.maps.SupportMapFragment" in your layout xml, you are now using your android:minSdkVersion under Android 3.0 or lower in your manifest.xml.

And then see my linked site below, which is helpful for you to understand what you should install and set before running the Google maps on your device. This link is very easy and you will get what you want to do in order to display google maps on your device.

My linked site ===> just Click here

BBonDoo
  • 766
  • 5
  • 14
  • I download your example and had the same problem. i run the project in 2 diferent devices with same results. sorry for bad language and thankyou for your answer – Damian SIlvera Jan 18 '13 at 16:58
  • Have you tried to input your API key in of your Manifest.xml ? – BBonDoo Jan 18 '13 at 20:01
0

Maybe your SHA1 key of your eclipse was changed (EX: You maybe deleted .android folder in home folder of windows) so it is the reason why it authentication error. You must delete your key and create new key with new SHA1 of eclipse. enter image description here

Regen new key in here and reload this page in some minutes, it will update new key: https://console.developers.google.com/project/watchful-net-796/apiui/credential

Remember! After all, you must copy new key to manifest and rebuild your project. Good luck!

nobjta_9x_tq
  • 1,205
  • 14
  • 16
0

you have missing api key

 <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="api key" />

enter api_key in value parameter

And google playService version is also missing . Add

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

to manifest inside <application tag

Zar E Ahmer
  • 33,936
  • 20
  • 234
  • 300