简体   繁体   中英

ClassNotFoundException Error. Something wrong with Eclipse IDE

It seems something wrong with Eclipse configuration after updating with android updates. When i want to use any external jar in my project it's throwing runtime exception. please have a look over logcat.

    09-09 11:08:59.605: W/dalvikvm(27652): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/google/zxing/client/android/CaptureActivity;
09-09 11:08:59.605: W/dalvikvm(27652): Class init failed in newInstance call (Lcom/androidaz/scanner/ScannerActivity;)
09-09 11:08:59.605: D/AndroidRuntime(27652): Shutting down VM
09-09 11:08:59.605: W/dalvikvm(27652): threadid=1: thread exiting with uncaught exception (group=0x41e292a0)
09-09 11:08:59.610: E/AndroidRuntime(27652): FATAL EXCEPTION: main
09-09 11:08:59.610: E/AndroidRuntime(27652): java.lang.ExceptionInInitializerError
09-09 11:08:59.610: E/AndroidRuntime(27652):    at java.lang.Class.newInstanceImpl(Native Method)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at java.lang.Class.newInstance(Class.java:1319)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at android.app.Instrumentation.newActivity(Instrumentation.java:1057)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2015)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at android.app.ActivityThread.access$600(ActivityThread.java:140)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at android.os.Looper.loop(Looper.java:137)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at android.app.ActivityThread.main(ActivityThread.java:4898)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at java.lang.reflect.Method.invokeNative(Native Method)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at java.lang.reflect.Method.invoke(Method.java:511)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
09-09 11:08:59.610: E/AndroidRuntime(27652):    at dalvik.system.NativeStart.main(Native Method)
09-09 11:08:59.610: E/AndroidRuntime(27652): Caused by: java.lang.NoClassDefFoundError: com.google.zxing.ResultMetadataType
09-09 11:08:59.610: E/AndroidRuntime(27652):    at com.google.zxing.client.android.CaptureActivity.<clinit>(CaptureActivity.java:107)
09-09 11:08:59.610: E/AndroidRuntime(27652):    ... 15 more

Please help me if i am missing anything. Please share your experience if any solution.

Right Click on your project -> Build Path -> Configure Build Path -> Order and Export Tab.

Make sure that "Android Private Libraries" is checked for Export.

If you've added any libraries from the libs/ folder, remove them as they are automatically added in the "Android Private Libraries" section.

I had this same error with ADT22. Resolved it by enabling "Android Private Libraries" in properties -> Java build path -> Order and export. If you are using any library projects, the same should be done for them as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM