Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to attach Android source to Eclipse?

While trying to debug a program I wrote in Eclipse for Android, I receive an error saying there's no source attachment for android.jar.

How do I get that source attached to Eclipse to continue my debugging?

like image 343
Doruk Karınca Avatar asked Dec 23 '11 20:12

Doruk Karınca


2 Answers

In Eclipse:

Window > Android SDK Manager, install "Sources for Android SDK" under Android 4.0

When prompted by "No sources attached...", click the button, then choose the Directory "your Android SDK directory/sources/android-API level/"

Example: C:\...\android-sdk-windows\sources\android-16

like image 81
Noureddine AMRI Avatar answered Sep 19 '22 21:09

Noureddine AMRI


If you really want to have the android.jar sources, follow these easy steps: (for Eclipse IDE)

  1. Install plugin Android Source by going to Help->Install New Software-> add this site: "http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update/". Select Android Sources from the list, click Next, and install like usual. Restart Eclipse when prompted.

  2. If sources are still not attached, attach them manually. You will find the sources in the plugin folder usually ECLIPSE_PATH\plugins\com.android.ide.eclipse.source_MAY_BE_VARY\VERSION Depending of the version of Android, they'll be in the different folders. (eg: for Android 4.4 the sources are in folder named 14). Sources will be in source.zip archive.

like image 38
user1451533 Avatar answered Sep 23 '22 21:09

user1451533