Android: How to reference a library project from an Eclipse ADT application project?

I have a project that compiles, but throws NoClassDefFoundError for the class name included in the sisters library project, but only when building from Eclipse. When I create a project from an ant file, it works fine.

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

This page ... http://developer.android.com/guide/developing/eclipse-adt.html#libraryReference since adding a library should "just work" without any other steps. And I see that he updated my default.properties with the necessary link, which does my work with the ant construct.

Despite the following steps (the project of my library is listed on the Android page of the properties of my application), Eclipse does not recognize new classes in the editor. So I took the standard Eclipse step to add the library to the Java build path. Now the compiler and the IDE recognize the class, but my application still crashes with NoClassDefFoundError, even after checking the library on the path to build, order, and export Java.

What step am I missing?

Some background ... First I built an Eclipse project. 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 with the library project I'm trying to use.

+3
4

, . , . "src" , .

+1

( IntelliJ Ant, Eclipse.) ​​ Aptana Studio, Eclipse. , Eclipse, .

+1

1) Android-.

2)

3) Android , .

4) . , , API.

5) "..", .

, , , "IsLibrary".

0

. . , , .

I found that in the Eclipse default.properties file, the location of the library project was not read because my working project was in a different driver than the library project (I did development on Windows). After transferring my project to the same disk as the library project, it began to work. This may work until the error is fixed.

0
source

Source: https://habr.com/ru/post/1766125/


All Articles