views:

169

answers:

1

I have a library-only Android eclipse project (no main class, only library classes) that I want to include in my main Android Application project.

I went to the Build Path and added the library project to the "Required projects on the build path" on the Projects tab, and checked it on the "Order and Export" tab.

However, when the application is run, it emits VerifyError exception, because the class from the library project didn't happen to be packaged together in the apk.

Any solution to this?

+3  A: 

Android projects don't get packaged in, unfortunately. If your library project only has classes, not resources, then you can make it a normal Java project. Java projects that an Android project depends on do get packaged in.

If the library project uses Android specific classes, then when you make it a Java project you also have to add android.jar to the build path. This will be "platforms/android-1.6/android.jar" inside your SDK directory if you have the 1.6 platform installed, for example.

Lance Nanek
You are correct. If I make the library project a Java project (as opposed to Android project), the classes get packaged in. Thanks!
yuku