oursgris
oursgris

Reputation: 2882

Debug Android library project with java source code

I followed the following tutorial http://developer.android.com/guide/developing/projects/projects-eclipse.html

and I have 2 projects : the starter project and the library project. Most of the source code is located into the library project

When I debug the android application and when I place a breakpoint into the java, the breakpoint work but it jump in the class file located in Library project folder (of the starter project).

I would like to stop in the java code, so I don't have to switch between the source and the compiled code and so modify the source. Is it possible ?

regards

Upvotes: 26

Views: 9090

Answers (2)

ZsJoska
ZsJoska

Reputation: 187

In my case, the solution was:

  • Open the debug view in eclipse (use the menu at the top: Window -> Show View -> Debug)
  • Right click one of the activities in the debug window "Edit source lookup"
  • Check the "Search for duplicate source files on the path"

jhnclvr's aswer lead me to this dialog

Upvotes: 5

jhnclvr
jhnclvr

Reputation: 9477

Here is what worked for me: (After having clicked debug at least once before)

  • Open the debug view in eclipse (use the menu at the top: Window -> Show View -> Debug)
  • Right click one of the activities in the debug window "Edit source lookup"
  • Click "Add"
  • Select "Java Project"
  • Check the box for the Android Library project
  • Press OK

Upvotes: 68

Related Questions