Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps v2 not displayed

I have been trying to run the sample project of the new Google maps V2 API

And a blank screen is shown.enter image description here

The question is why is it not showing the map on a 2.2 device, on the stacktrace I see the following message:

  12-06 09:40:36.039: W/dalvikvm(14657): Unable to resolve superclass of Lmaps/a/du; (411)
  12-06 09:40:36.039: W/dalvikvm(14657): Link of class 'Lmaps/a/du;' failed
  12-06 09:40:36.039: W/dalvikvm(14657): Unable to resolve superclass of Lmaps/a/ej; (2363)
  12-06 09:40:36.039: W/dalvikvm(14657): Link of class 'Lmaps/a/ej;' failed
  12-06 09:40:36.039: W/dalvikvm(14657): Unable to resolve superclass of Lmaps/j/k; (2379)
  12-06 09:40:36.039: W/dalvikvm(14657): Link of class 'Lmaps/j/k;' failed
  12-06 09:40:36.039: E/dalvikvm(14657): Could not find class 'maps.j.k', referenced from method maps.y.ae.a
  12-06 09:40:36.039: W/dalvikvm(14657): VFY: unable to resolve new-instance 3571 (Lmaps/j/k;) in Lmaps/y/ae;
  12-06 09:40:36.039: D/dalvikvm(14657): VFY: replacing opcode 0x22 at 0x007d
  12-06 09:40:36.125: D/dalvikvm(14657): VFY: dead code 0x007f-008f in Lmaps/y/ae;.a (Landroid/view/LayoutInflater;Lcom/google/android/gms/maps/GoogleMapOptions;Z)Lmaps/y/ae;
  12-06 09:40:36.192: I/dalvikvm(14657): Could not find method java.io.IOException.<init>, referenced from method maps.bg.e.a
  12-06 09:40:36.195: W/dalvikvm(14657): VFY: unable to resolve direct method 14965: Ljava/io/IOException;.<init> (Ljava/lang/String;Ljava/lang/Throwable;)V
  12-06 09:40:36.195: D/dalvikvm(14657): VFY: replacing opcode 0x70 at 0x0087
  12-06 09:40:36.195: D/dalvikvm(14657): VFY: dead code 0x008a-008c in Lmaps/bg/e;.a ([B)Ljava/util/Hashtable;
  12-06 09:40:36.555: D/dalvikvm(14657): GC_FOR_MALLOC freed 4020 objects / 327288 bytes in 61ms
  12-06 09:40:36.707: E/Google Maps Android API(14657): Google Maps application is missing.

Edit: well it seems like we can't run it yet on the emulator, yet.

like image 420
meh Avatar asked Dec 05 '12 16:12

meh


4 Answers

The logcat saw the following message:

12-06 09:40:36.707: E/Google Maps Android API(14657): Google Maps application is missing.

So Installing Google Maps has solved the problem.

Also it Seems like the google maps installation is blocked in some countries, and running the application on 2.2 simply won't work without the google maps installed.

From the comment a user has posted a code to check if google maps is installed in the following question:

Google Maps Android API V2 check if GoogleMaps are installed on device

like image 180
meh Avatar answered Oct 21 '22 03:10

meh


I am yet to test this, but I am going to assume you need the google play services on your device, check for following on your device:

play services app

If this is missing I have a feeling that the new GMS will not work, as your emulator has no google maps OR google play services this will stop it working as it can't find the package.

From the looks of it, GMS fails silently on a real device instead of crashing like the emulator.

Manually install Google Play Services on your device and try again.

like image 42
Chris.Jenkins Avatar answered Oct 21 '22 04:10

Chris.Jenkins


I've had similar problem. After installing (and later uninstalling) Google Maps, everything settled down.

like image 29
GoranK Avatar answered Oct 21 '22 04:10

GoranK


Make sure to include a call to:

GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo

somewhere in your application (i.e. about section). I had the same problem until I used this.

(I understand this post is a month old and the user may have moved on in development, however others may benefit from this bit of info as I did)

like image 38
user1610177 Avatar answered Oct 21 '22 05:10

user1610177