Android - Google Maps API v2 - NoClassDefFoundError
I finally ran my application!
I didn't edit manifest, layout and activity, just updated project settings:
I hope this will help someone.
1. Remove this permission from the manifest file:
<uses-library android:name="com.google.android.maps" />
it's part of Google Maps API V1 and not needed in Google Maps API V2.
2. Move the meta-data part to be right before the closing application tag:
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="MY_KEY"/></application>
3. Regenerate a new key and register it via the Google API Console and make all the process again.
Follow these directions first
For the sake of completeness of documentation, download and get your keys and project setup.
Installing the Google Maps Android v2 API
The IntelliJ Specific Part
The Modules
Import the google-play-services_lib as a module into the project.
${ANDROID_SDK_ROOT}/extras/google/google_play_services/libproject/google-play-services_lib
Now make sure it is set as a Library module
Go into your project settings and make sure you add the module as a dependency. Take note of the folder icon.
Add the
google-play-services.jar
as a library to your module and one of the Android support modules if you plan to support older devices. Most people useandroid-support-v4.jar
, but in my example I usedandroid-support-v13.jar
which includes everything in v4. This is where you get support forFragment
on older phones.