tbeernot
tbeernot

Reputation: 2612

ClassDefNotFound in Android

I've been jumping through hoops trying to include my utility jar in my project. Android documentation clearly states that all the import-via-filesystem should not be necessary (http://developer.android.com/resources/faq/commontasks.html#addexternallibrary) but I've tried all suggestions anyhow; putting in it a libs folder, clean the project, restarting eclipse.

Is there any way I can see how eclipse builds the project; I'd like to see that it actually tries to include my jar.

Upvotes: 1

Views: 1006

Answers (3)

tbeernot
tbeernot

Reputation: 2612

I was never able to solve the problem, but it seems to be caused by the Android cross compiler not being able to correctly process the generated Jar. As a work around I started copying the java files from the utility project into the Android project.

Upvotes: 0

Houcine
Houcine

Reputation: 24181

Build and Clean is not enough, you should add your jar file by configuring the Build Path. Follow these steps:

  • Right Click on your project
  • => Properties
  • => Java Build Path ( at left )
  • => choose the tab Libraries
  • => add jars
  • => specify your jar file that you have added it to the lib folder.

Hope it helps and sorry for my English

Upvotes: 3

Gubbel
Gubbel

Reputation: 2396

It seems that adding the jar to the build path isn't enough. You have to copy the jar to the project's folder (like to /libs).

Upvotes: 1

Related Questions