Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Eclipse, how can I quickly access the source of an "android library project" from the source of a project that uses it?

  • Project A is an android library project in my workspace(via project properties->android->library: is library).
  • Project A declares classA.
  • Project B uses project A (via project properties->android->library: add...).
  • Project B instantiates classA.

When I use F3 ("open declaration") over the classA instance in project B, it leads me to the classA.class in the A.jar that is included in B, built from A.

Is there a way to go directly to the source classA.java in project A rather than looking for it in the package explorer?

I think this is new to ADT14, formerly there were X_src folder for each included library project: e.g. A_src would appear in B as a source folder in the root of the project.

like image 338
mamuso Avatar asked Oct 25 '11 23:10

mamuso


1 Answers

Right click on the non-library project (Project B) and select Build Path:

  • In the Projects tab, add the library project Project A as a dependency.
  • In the Order and Exports tab, be sure Project A is given higher precedence than the placeholder/bundle Library Projects.

I had to do both of these steps in order to fix this issue, with ADT15, Eclipse 3.7 and new projects.

like image 81
mik3y Avatar answered Oct 20 '22 22:10

mik3y