How to attach Android source to Eclipse?

后端 未结 3 872
[愿得一人]
[愿得一人] 2020-12-05 00:27

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.

<
相关标签:
3条回答
  • 2020-12-05 00:57

    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)

    0 讨论(0)
  • 2020-12-05 01:07

    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.

    0 讨论(0)
  • 2020-12-05 01:12

    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

    0 讨论(0)
提交回复
热议问题