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


痞子三分冷 提交于 2019-12-10 14:35:54

问题


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?)


回答1:


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.



来源:https://stackoverflow.com/questions/10735870/eclipse-adt-cannot-set-conditional-breakpoint-on-sdk-sources-missing-java-proje

工具导航Map