Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps Android API gives a NoClassDefFoundError

Tags:

My app just consists of a map with an overlay, but when I create my MapView, my app crashes with a NoClassDefFoundError. I'm using the Google API AVD that matches my target, but apparently I'm still doing something wrong. Any ideas?

EDIT: In case it helps, my NoClassDefFoundError is complaining about [generic]. I can understand why there's no class definiton for [generic], but I'm not sure where that's coming from.

Also, a later ClassNotFoundException complains of com.google.android.maps.MapView in loader dalvik.system.PathClassLoader[/data/app/mathphreak.cellmap-1.apk], and that then goes on to cause a different NoClassDefFoundError for java.lang.NoClassDefFoundError: com.google.android.maps.MapView.

like image 365
Melody Horn Avatar asked Sep 25 '10 02:09

Melody Horn


People also ask

Is Google Maps API restful?

Since Google Map APIs support both json and xml , it can be safely said they they are implemented in REST.

Is Google Maps API no longer free?

You won't be charged until your usage exceeds $200 in a month. Note that the Maps Embed API, Maps SDK for Android, and Maps SDK for iOS currently have no usage limits and are at no charge (usage of the API or SDKs is not applied against your $200 monthly credit).

What does Google Map API do in Android?

With the Maps SDK for Android, add maps to your Android app including Wear OS apps using Google Maps data, map displays, and map gesture responses. You can also provide additional information for map locations and support user interaction by adding markers, polygons, and overlays to your map.


1 Answers

Make sure you have included the following line in your application manifest:

<uses-library android:required="true" android:name="com.google.android.maps" />

and make sure it's in the correct place. My problem (had similar error messages) was that I had put this in there but like the uses-permission stuff it was just under the root element manifest, when in fact the uses-library element is suppose to be placed under the application element. In case I wasn't clear enough see the part: Configuring the application manifest from Sameers link.

like image 51
Timo Avatar answered Oct 13 '22 00:10

Timo