views:

58

answers:

0

I have a project that is compiles but throws a NoClassDefFoundError on a classname included from a sibling library project, but only when built from Eclipse. When I build the project from the ant file, it runs just fine.

How do I tell the Eclipse build system that my application's .apk needs a copy of the .class files from the library project.

This page... http://developer.android.com/guide/developing/eclipse-adt.html#libraryReference makes is sound like adding the library should "just work" with no other steps. And I see it has updated my default.properties with the necessary link that makes my ant build work.

Despite following those steps (my library project is listed in the Android page of my application's project properties), Eclipse doesn't recognize the new classes in the editor. So I did the standard Eclipse step of adding the library to the Java Build Path. Now the compiler and IDE recognize the class, but my app still crashes with NoClassDefFoundError, even after checking the library in the Java Build Path, Order and Export.

What step am I missing?

Some background... I built the Eclipse project first. Then, in a separate directory, I used android create project ... with all the parameters to create an identically configured project. Finally, I copied the ant build.xml and *.properties files to the Eclipse project directory. I did the same thing with the library project I'm trying to reference.