12

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.

meh
  • 22,090
  • 8
  • 48
  • 58
  • You must install Google Play Store on your emulator. See my answer to this question I think it might help http://stackoverflow.com/questions/13691943/this-app-wont-run-unless-you-update-google-play-services-via-bazaar – Nemanja Kovacevic Dec 06 '12 at 00:51

6 Answers6

7

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

meh
  • 22,090
  • 8
  • 48
  • 58
  • I asked a similar question and wrote up a post on how to programmatically check if Google Maps are installed, and redirect the user to the Play Store if Google Maps are not installed. See this question: http://stackoverflow.com/questions/13778965/google-maps-android-api-v2-check-if-googlemaps-are-installed-on-device – DiscDev Dec 09 '12 at 18:03
  • in my case the google maps application could not be installed directly from the market. – meh Dec 09 '12 at 22:36
  • This is a little worrying :/ Would hope the PlayServices API would handle this! – Chris.Jenkins Dec 10 '12 at 14:11
  • Me too, but it didn't. I had the latest version installed and still nothing helped. – meh Dec 10 '12 at 14:38
3

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.

Chris.Jenkins
  • 13,051
  • 4
  • 60
  • 61
1

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

GoranK
  • 1,628
  • 2
  • 12
  • 22
1

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)

user1610177
  • 177
  • 1
  • 3
  • 11
  • It is used to check the availability of the google play services, the problem is that the user might not have the google maps installed on his device. – meh Jan 03 '13 at 14:53
  • The statement I made above refers to what Google expect you to put in your application to give credit to their licences. Without it, my implementation was not working. – user1610177 Jan 03 '13 at 16:39
1

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.

user1976945
  • 41
  • 1
  • 3
0

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 ;-)

Jszn
  • 133
  • 2
  • 10