Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse ADT cannot set conditional breakpoint on SDK sources: missing java Project context

I am trying to debug a simple Android app with Eclipse 3.7.1. I attachted the Android SDK sources so I can step through the code of the SDK also. I can set unconditional breakpoints on code of the SDK but not conditional breakpoints. I get the following error message if I try:

Conditional Breakpoint Error

Conditional breakpoint has compilation error(s).

Reason:

Unable to compile conditional breakpoint - missing java Project context

Conditional breakpoints on by own sources work, however.

The only relevant search result on the topic I found suggests to convert the project containing the third party jar into a Java project. But I do not know how to do this for the Android SDK, i.e. how to add it as an Eclipse project at all. (Would that be even sensible?)

like image 257
jhunovis Avatar asked May 24 '12 10:05

jhunovis


1 Answers

To fix this error, create a new Java project for the Android library your project uses. Link the sources of the Android library delivered by the SDK to that project. Exclude everything (*), otherwise warning and error messages will flood your log! Attach the source code from that new project to the «android.jar» your project uses. That's it.

I wrote a more step-by-step solution here.

like image 186
jhunovis Avatar answered Sep 30 '22 11:09

jhunovis