Issue
I have a mapview class which extends MapActivity. The code i'm using follows the Hello Map View tutorial. The map activity is started by pressing a button using the following code:
public void showMap() {
Intent myIntent = new Intent(MainActivity.this, googleMapsView.class);
MainActivity.this.startActivity(myIntent);
}
The problem i'm having is that the app crashes when I launch the map view, I get the following error in log cat:
09-06 15:50:03.507: ERROR/AndroidRuntime(877): FATAL EXCEPTION: main
09-06 15:50:03.507: ERROR/AndroidRuntime(877): java.lang.NoClassDefFoundError: com.android.googleMapsView
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at com.android.MainActivity.showMap(MainActivity.java:832)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at com.android.MainActivity$3$2.onClick(MainActivity.java:262)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at android.view.View.performClick(View.java:3110)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at android.view.View$PerformClick.run(View.java:11934)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at android.os.Handler.handleCallback(Handler.java:587)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at android.os.Handler.dispatchMessage(Handler.java:92)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at android.os.Looper.loop(Looper.java:132)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at android.app.ActivityThread.main(ActivityThread.java:4123)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at java.lang.reflect.Method.invokeNative(Native Method)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at java.lang.reflect.Method.invoke(Method.java:491)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at dalvik.system.NativeStart.main(Native Method)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): Caused by: java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at dalvik.system.DexFile.defineClass(Native Method)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:207)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:211)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at java.lang.ClassLoader.loadClass(ClassLoader.java:540)
09-06 15:50:03.507: ERROR/AndroidRuntime(877): at java.lang.ClassLoader.loadClass(ClassLoader.java:500)
Solution
Make sure that you've specified Google APIs as the project build target. Also make sure that you have this line in the manifest file:
<uses-library android:name="com.google.android.maps" />
Answered By - Andrej Cvoro
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.