NoClassDefFoundError at Google Play Services V2 library
Version 2 includes resources and must be imported as a library project. See the instructions at http://developer.android.com/google/play-services/setup.html for how to do that in various IDEs.
The resources are for GooglePlayServicesUtil.getErrorDialog(), which directs the user to install, update, enable, etc. Google Play services if it isn't available on the device.
NoClassDefFoundError Google-Play-Services / Maps
I don't think you need the line:
<uses-library
android:name="com.google.android.maps"
android:required="true" />
In fact, I think that's the name of the old maps library. Try removing it and see if that fixes your problem. Also, make sure your code is importing from com.google.android.gms.maps
and com.google.android.gms.maps.model
, the packages for Google Maps API V2.
UPDATE
Your build configuration isn't including the Google Play Services jar in your APK.
To fix this in IntelliJ: https://stackoverflow.com/a/17977734/1235702
To fix this in Eclipse, follow steps 3 and 4 here: https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw (I didn't write this doc, but kudos to whoever did!)
- Add the Google Play Services project into your Eclipse workspace.
- Click File -> Import..., select Android -> Existing Android Code into Workspace
Browse to and select /extras/google/google_play_services/libproject/google-play-services_lib- To add the dependency to Google Play Services into your project
- Project -> Properties -> Android -> Library, Add -> google-play-services_lib
(Sorry; the markdown won't let me set the numbers to 3 and 4 explicitly.)
Screenshot from OP for posterity:
NoClassDefFoundError with Google Play Services 9.2.0 (Admob)
So next day I added the Android library "play-services-basement" as a dependency to my project and everything worked. Didn't realize I needed to add that as a dependency directly to my own project since admob/analytics projects implicitly added it as well.
java.lang.NoClassDefFoundError for any google-play-services feature
I wasted a lot of time of findout the solution. The core of bug is Android SDK updating went wrong, old version of Eclipse, not enought memory for Eclipse Java Machine (more detailed about memory bug here).
Even I've tryed to update build tools, API, etc. it didn't work. But I just downloaded new SDK and fully reinstalled and this helped. Do not forget to install new Eclipse and ADT. Do not forget about memory increasing in eclipse.ini file.
java.lang.noclassdeffounferror google play services
What i have done to add google-play-services is that import a new project into eclipse workspace, and that path of that was be
android-sdk-macosx/extras/google/google_play_services/libproject/google-play-services_lib
and add as library in your project.. that it .. simple!! you might require to add support library in your project.
java.lang.noclassdeffounderror: com.google.android.gms.R$styleable
What you have to do is include a Google Play Services library to your project. Google has very good instructions here:
- http://developer.android.com/google/play-services/setup.html
Also, there is a quick start which I found very useful while trying to get Google Maps v2 to work.
- https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw
getting error java.lang.NoClassDefFoundError: com.google.android.gms.common.GooglePlayServicesUtil
Are you using Eclipse? If Eclipse sees a jar file for compilation, it does not necessarily include it into the apk. (You have to mention the jar in several places, and usually people do not remember in how many places.)
ritht-click on the project name -- build path -- configure build path -- order and export.
The same dialog has a Projects tab, this is where you specify projects you depend on.
If that does not work, put the jar into the libs subdirectory of your project.
Google Maps V2 / Google Play Services NoClassDefFoundError
go to project properties at java build path and check everything from order and export
Related Topics
Could Not Access the Package Manager. Is the System Running While Installing Android Application
Android:How to Update the Selector(Statelistdrawable) Programmatically
Measuring a View Before Rendering It
How to Simulate Accelerometer in Android Emulator
Webview Textarea Doesn't Pop Up the Keyboard
How to Set Spinner Default Value to Null
How to Show Progress Dialog in Android
How to Execute a Method by Clicking a Notification
How to Change Color of Listview Items on Focus and on Click
Applying Effects on Video Being Played
Programmatically Enter Secret Code Like *#*#4636#*#* on Android
Android Install_Failed_Uid_Changed
Incorrect Coordinates from Getlocationonscreen/Getlocationinwindow
Spinner:Onitemselected Not Called When Selected Item Remains the Same