meh
meh

Reputation: 22479

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.

Upvotes: 12

Views: 9342

Answers (6)

meh
meh

Reputation: 22479

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

Upvotes: 7

Jszn
Jszn

Reputation: 133

A good solution for the emulator is Genymotion!
Download it after sign in @ http://www.genymotion.com
Install it & virtual box
In eclipse search for http://plugins.genymotion.com/eclipse in "install new software" .
Open an emulator with it, create a virtual device with "google apps", install on it the play service, and that's all, when you compile your app, u can choose the genymotion emulate device..
That take a lot of memory, but works really better than AVD ;-)

Upvotes: 0

user1976945
user1976945

Reputation: 41

I experienced the same issues with an android 2.3.7 device and none of the answers online were pointing me in the right direction. On a wild hair I force quit play services and relaunched my application and the maps began to render.

Upvotes: 1

user1610177
user1610177

Reputation: 177

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)

Upvotes: 1

GoranK
GoranK

Reputation: 1668

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

Upvotes: 1

Chris.Jenkins
Chris.Jenkins

Reputation: 13139

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.

Upvotes: 3

Related Questions