user987723
user987723

Reputation: 965

noclassdefFoundError after running update

Hi I'm new to android development. I took over a project when someone left my company recently and I was able to build and run the app ok. Since running an update on eclipse I can no longer run the app, I get this error:

07-29 10:27:13.843: E/AndroidRuntime(314): FATAL EXCEPTION: main
07-29 10:27:13.843: E/AndroidRuntime(314): java.lang.NoClassDefFoundError: uk.co.mosquitodigital.panic.dao.DaoMaster
07-29 10:27:13.843: E/AndroidRuntime(314):  at uk.co.mosquitodigital.panic.dao.DaoMaster$OpenHelper.onCreate(DaoMaster.java:48)
07-29 10:27:13.843: E/AndroidRuntime(314):  at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:106)
07-29 10:27:13.843: E/AndroidRuntime(314):  at uk.co.mosquitodigital.panic.PanicApplication.onCreate(PanicApplication.java:64)
07-29 10:27:13.843: E/AndroidRuntime(314):  at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:969)
07-29 10:27:13.843: E/AndroidRuntime(314):  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4244)
07-29 10:27:13.843: E/AndroidRuntime(314):  at android.app.ActivityThread.access$3000(ActivityThread.java:125)
07-29 10:27:13.843: E/AndroidRuntime(314):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
07-29 10:27:13.843: E/AndroidRuntime(314):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-29 10:27:13.843: E/AndroidRuntime(314):  at android.os.Looper.loop(Looper.java:123)
07-29 10:27:13.843: E/AndroidRuntime(314):  at android.app.ActivityThread.main(ActivityThread.java:4627)
07-29 10:27:13.843: E/AndroidRuntime(314):  at java.lang.reflect.Method.invokeNative(Native Method)
07-29 10:27:13.843: E/AndroidRuntime(314):  at java.lang.reflect.Method.invoke(Method.java:521)
07-29 10:27:13.843: E/AndroidRuntime(314):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-29 10:27:13.843: E/AndroidRuntime(314):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-29 10:27:13.843: E/AndroidRuntime(314):  at dalvik.system.NativeStart.main(Native Method)

Upvotes: 2

Views: 500

Answers (2)

Kumar Vivek Mitra
Kumar Vivek Mitra

Reputation: 33534

1. First thing you must do is to Clean the project.

2. Properly configure the Build Path.

3. If there are external Libraries, then create a "libs" folder in your project, and then configure the Build Path.

4. Restart your Eclipse

Upvotes: 0

Raghav Sood
Raghav Sood

Reputation: 82543

There are only three reasons you will ever get this error:

  1. The class genuinely doesn't exist. If you are using code from an official example and getting this, make sure you have the latest build of the library
  2. You have not added the jar to your build path. To fix this, right click on the jar in Eclipse, and do Build Path ► Add to Build Path.
  3. Your jar is not in the /libs folder. This happens when you have added the jar to the build path, but newer versions of ADT need it to be in /libs. Put it there and re-add it to the build path.

Mostly, such errors occur because newer versions of the ADT require all external jars to be in the libs folder. Your colleague was probably on a different version than you, and hence the error.

Upvotes: 2

Related Questions