3

Whenever I try to debug my app, Eclipse open a Class File Editor and gives a Source not Found and generally for basic Java classes (For example, Looper.class). I am really sick of this. I cannot debug well because of these Source not Founds. Is there a way to solve this?

Thank you!

ciyo
  • 725
  • 4
  • 16
  • 36

2 Answers2

2

Go to Help > Install new Software... in eclipse and add the update site: http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update/

You can then download the android sources.

Update: For more recent versions of Android (API level 14 and up), the Android SDK Manager allows you to download the source for a specific API level. You can do that and then when you get the Source not Found message, you can attach the source by entering the path to downloaded source (which should be in your SDK location).

HexAndBugs
  • 5,549
  • 2
  • 27
  • 36
  • Did you attach the source by entering the path? – HexAndBugs May 21 '13 at 21:59
  • I tried both `android-sdk/platforms/android-17/android.jar` and `Workspace Location` – ciyo May 21 '13 at 22:07
  • It could be because I did not add `android:debuggable="true"` to the manifest? – ciyo May 21 '13 at 22:09
  • I think you'll need to select Add external folder when you try to add the source and then go to `android-sdk/sources/android-17` if you followed the advice in the Update part of my original post. – HexAndBugs May 21 '13 at 22:16
-1

I assume that in the manifest file you have android:debuggable="true" and Eclipse is able to find the sources. For the Android platform sources, do you have the platform sources downloaded?

Rodrigo Taboada
  • 2,727
  • 4
  • 24
  • 27
Ritz
  • 1
  • No, android:debuggable is not true. I did not add this line and I downloaded and updated everything from SDK Manager and also Eclipse-Plugin – ciyo May 21 '13 at 21:24
  • You would need the platform sources not just the jar file, to be able to get to the "Looper.java" and not Looper.class – Ritz May 22 '13 at 00:09
  • http://stackoverflow.com/questions/23986724/can-not-set-debuggable-flag-in-androidmanifest-xml See official doc for SDK Tools, Revision 8 (December 2010) Support for a true debug build. Developers no longer need to add the android:debuggable attribute to the tag in the manifest — the build tools add the attribute automatically. – Paul Verest Sep 28 '14 at 11:33