I am trying to run sample code mention here : Google Maps Android API V2 Sample code
but i am getting error NoClassDefFound. Below is my logcat.
Can any one help me to solve it. Any help is highly appricated Thanks
12-04 18:04:18.854: E/AndroidRuntime(1801): java.lang.ExceptionInInitializerError
12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.Class.newInstanceImpl(Native Method)
12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.Class.newInstance(Class.java:1319)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.os.Handler.dispatchMessage(Handler.java:99)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.os.Looper.loop(Looper.java:137)
12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.reflect.Method.invokeNative(Native Method)
12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.reflect.Method.invoke(Method.java:511)
12-04 18:04:18.854: E/AndroidRuntime(1801): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-04 18:04:18.854: E/AndroidRuntime(1801): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-04 18:04:18.854: E/AndroidRuntime(1801): at dalvik.system.NativeStart.main(Native Method)
12-04 18:04:18.854: E/AndroidRuntime(1801): Caused by: java.lang.NoClassDefFoundError: com.example.mapdemo.BasicMapActivity
12-04 18:04:18.854: E/AndroidRuntime(1801): at com.example.mapdemo.MainActivity.<clinit>(MainActivity.java:98)
12-04 18:04:18.854: E/AndroidRuntime(1801): ... 15 more
There are a several reasons why your google maps may not be working, the most common issue being no Google Map API key set or set incorrectly. To use the Google Maps JavaScript API, you must register your app project on the Google Cloud Platform Console and get a Google API key which you can add to your app.
Open the Credentials page of the Google dashboard. Find your key in the list and click on the name: Check for any restrictions under API Restrictions.
I had the same problem and got resolved by doing the following,
After this everything worked for me.
This worked for me.
Once you have imported the Android-Support-V4.jar and the Google_Play_Services_lib.jar, go to:
Project Properties > Java Build Path > Order and Export.
Then ensure you the check boxes beside Android-Support-V4.jar and the Google_Play_Services_lib.jar are selected.
Click ok, then run. All should be well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With