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
.
In Eclipse package explorer:
Right click
on android.jar then Maven->Donwload Sources
.
Wait a bit until the process is finished and you're done. (I am not sure if checking "Install Sources" in Android SDK Manager is a prerequisite for this, but you can try and tell us)
If you really want to have the android.jar sources, follow these easy steps: (for Eclipse IDE)
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.
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.
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