Question

I installed a bunch of updates via Android SDK Manager this morning including Android SDK Tools 22.0.1. This has seemed to be disastrous so far. One disaster is handling libraries. Here is the scenario:

I have a project projFoo that uses a library project libFoo. libFoo uses a dozen or so libraries or projects. In other words, libFoo has the following in its Java Build Path: projA, projB, projC,... lib1.jar, lib2.jar, lib3.jar ...

I used to need only adding libFoo to the build path of projFoo, and everything was working fine until I installed the updates.

After the updates, I have been adding projA, projB, lib1.jar one by one to projFoo's build path even though projFoo does not use them directly. Without doing this, java.lang.NoClassDefFoundError would occur when I run the app.

I have cleaned all projects and restarted Eclipse many times. I also checked those referenced projects and libraries in Order and Export of libFoo, but adding those references still seems to be necessary. Is this the right way to handle this?

Was it helpful?

Solution

In the order and export tab of Java Build Path make sure Android private Libraries and Android Dependencies are checked.

Any libraries in .jar format should just go in the libs folder of your project. There's no need to add them to the build path.

Any libraries that are a project can just be added to the Java Build Path Projects tab, or if it is an android project, you can add it to the Library section under the Android pane.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top