Question

When I am trying to look at platform JAR or when I am debugging my android application in Eclipse, the following screen always show.

enter image description here

I have read some of the posts online and understand that Android SDK does not come with Source Code. But how can I download the correct version of source code and attach in Eclipse?

I guess the following link provides the right solution for me, however, unfortunately it is outdated and I can download the source code for only Cupcake(1.5), Donut(1.6) & Eclair(2.1).

Attaching Android platform source in Eclipse

Can anyone provide me the link to download the source code for Ice Cream Sandwich(4.0.3)? Any help will be much appreciated.

Was it helpful?

Solution

My problem was solved by following a few steps below.

1) I downloaded the source code via Android SDK Manager. (The sources are downloaded to the source directory located in "path_to_android_sdk/sources/android-xx”). xx is the API level number (15 for 4.0.3). Android Versions and API Levels can be found in the following link for your convenience.

Android Versions and API Levels

2) I zipped the downloaded file. (android-15 in this case)

3) In "Source Not Found" page, I clicked "Attach Source" button and chose the zip file that I archived in step 2.

OTHER TIPS

For some time now, the Android SDK Manager allows you to install the sources for most SDK levels. Make sure your Android plugin for Eclipse is up to date. Start the SDK Manager and make sure you have the latest version of the tools. Then, under each SDK level, there should be an item titled Sources for SDK. Make sure that is installed for the level you want.

If the sources still are not available to the Eclipse debugger, right click on the project in the Package Explorer pane, navigate to Android Tools, and select "Fix Project Properties".

The Android source tree is located in a Git repository hosted by Google. This document describes how to download the source tree for a specific Android code-line.

You can follow this link

http://source.android.com/source/downloading.html

and download the source code

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top