Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting error "Caused by: java.lang.NoClassDefFoundError:" but the class is existing
    text
    copied!<p>I am trying to figureout what is wrong with following code that is causing "class not found" exception but I am not able to solved it. </p> <p>I am starting an activity that is extending MapActivity from mapquest-android-sdk-1.0.5.jar map quest library. </p> <pre><code> public void onRoutePlanButtonClick(View v) { start = ((EditText) findViewById(R.id.start)).getText().toString(); destination = ((EditText) findViewById(R.id.destination)).getText() .toString(); Driver driver = new Driver(); driver.setStart(start); driver.setDestination(destination); Intent intent = new Intent(this, DriverMap.class); startActivity(intent); } </code></pre> <p>the class DriverMap exists in com.thumbup.driver but the following code is causing the error</p> <pre><code>Intent intent = new Intent(this, DriverMap.class); </code></pre> <p>NOTES: </p> <ol> <li>I made sure the map quest lib is on the correct path</li> <li>When I call another Activity then it works without any problem</li> <li>DriverMap extends ThumbUpMap implements ThumbUpLocationProvider</li> <li>The activity that is calling DriverMap is storing some data locally, using SharedPreferences</li> <li>I am using Android 2.3.3</li> </ol> <p>Error from LogCat (adroid SDK):</p> <pre><code>06-03 14:29:24.558: E/dalvikvm(1979): Could not find class 'com.thumbup.driver.DriverMap', referenced from method com.thumbup.driver.Journey.onRoutePlanButtonClick 06-03 14:29:24.558: W/dalvikvm(1979): VFY: unable to resolve const-class 58 (Lcom/thumbup/driver/DriverMap;) in Lcom/thumbup/driver/Journey; 06-03 14:29:24.558: D/dalvikvm(1979): VFY: replacing opcode 0x1c at 0x0037 06-03 14:29:24.558: D/dalvikvm(1979): VFY: dead code 0x0039-003f in Lcom/thumbup/driver/Journey;.onRoutePlanButtonClick (Landroid/view/View;)V 06-03 14:29:38.238: D/AndroidRuntime(1979): Shutting down VM 06-03 14:29:38.238: W/dalvikvm(1979): threadid=1: thread exiting with uncaught exception (group=0x40015578) 06-03 14:29:38.246: E/AndroidRuntime(1979): FATAL EXCEPTION: main 06-03 14:29:38.246: E/AndroidRuntime(1979): java.lang.IllegalStateException: Could not execute method of the activity 06-03 14:29:38.246: E/AndroidRuntime(1979): at android.view.View$1.onClick(View.java:2154) 06-03 14:29:38.246: E/AndroidRuntime(1979): at android.view.View.performClick(View.java:2538) 06-03 14:29:38.246: E/AndroidRuntime(1979): at android.view.View$PerformClick.run(View.java:9152) 06-03 14:29:38.246: E/AndroidRuntime(1979): at android.os.Handler.handleCallback(Handler.java:587) 06-03 14:29:38.246: E/AndroidRuntime(1979): at android.os.Handler.dispatchMessage(Handler.java:92) 06-03 14:29:38.246: E/AndroidRuntime(1979): at android.os.Looper.loop(Looper.java:123) 06-03 14:29:38.246: E/AndroidRuntime(1979): at android.app.ActivityThread.main(ActivityThread.java:3687) 06-03 14:29:38.246: E/AndroidRuntime(1979): at java.lang.reflect.Method.invokeNative(Native Method) 06-03 14:29:38.246: E/AndroidRuntime(1979): at java.lang.reflect.Method.invoke(Method.java:507) 06-03 14:29:38.246: E/AndroidRuntime(1979): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842) 06-03 14:29:38.246: E/AndroidRuntime(1979): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) 06-03 14:29:38.246: E/AndroidRuntime(1979): at dalvik.system.NativeStart.main(Native Method) 06-03 14:29:38.246: E/AndroidRuntime(1979): Caused by: java.lang.reflect.InvocationTargetException 06-03 14:29:38.246: E/AndroidRuntime(1979): at java.lang.reflect.Method.invokeNative(Native Method) 06-03 14:29:38.246: E/AndroidRuntime(1979): at java.lang.reflect.Method.invoke(Method.java:507) 06-03 14:29:38.246: E/AndroidRuntime(1979): at android.view.View$1.onClick(View.java:2149) 06-03 14:29:38.246: E/AndroidRuntime(1979): ... 11 more 06-03 14:29:38.246: E/AndroidRuntime(1979): Caused by: java.lang.NoClassDefFoundError: com.thumbup.driver.DriverMap 06-03 14:29:38.246: E/AndroidRuntime(1979): at com.thumbup.driver.Journey.onRoutePlanButtonClick(Journey.java:32) 06-03 14:29:38.246: E/AndroidRuntime(1979): ... 14 more </code></pre> <p><strong>When I swtiched to Android 2.3.3, it is working! but not with 4.2.2</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload