Android project referencing "normal" java project in eclipse since sdk tools update 17

clamp picture clamp · Mar 27, 2012 · Viewed 8.7k times · Source

Since the latest android sdk i am unable to run my android applications from eclipse anymore because they cant find classes which i have in other eclipse projects, which are references via the 'normal' build path.

this has definitely worked before. and there are no compile errors in eclipse.

could it be that, now you have to mark those projects as android library projects in case they are referenced by an android project.

edit: it seems that this is the reason why it is broken: http://tools.android.com/recent/dealingwithdependenciesinandroidprojects

but i still have to figure out how i should now reference my "normal" java projects to the android app project.

Answer

thalador picture thalador · Apr 19, 2012

In the link @clamp provided there is the following sentence:

The container will now also be populated with Java-only projects that are referenced by Library Projects.

This means, that we can use a empty library project as a "glue" project between the android project and the regular eclipse project. Just set it up like this:

android --> "glue" project --> regular project

--> means depends on

The glue project has to export the regular project and has to be marked as library. In the android project only the library project has to be referenced.

Now using a regular eclipse project works again for me with the minimal overhead of the "glue" project.