can any one provide me solution to this error i have searched alot to this problem but failed
i am using eclipse with ADT
with android sdk 2.0.1
OS Micr
we can get it follow the first way, detail show:
my android.jar path is:/home/davidbei/developSW/DevTools/androidSDK/android-sdk_eng.davidbei_linux-x86/platforms/android-2.2.1/android.jar
so put the unzip sources folder into /home/davidbei/developSW/DevTools/androidSDK/android-sdk_eng.davidbei_linux-x86/platforms/android-2.2.1/sources, means apache-http,base&dalvik, those three folders in /home/davidbei/developSW/DevTools/androidSDK/android-sdk_eng.davidbei_linux-x86/platforms/android-2.2.1/sources.
that's all. in windows it is the same, maybe ~~
Does this article "Making Eclipse show Android’s source" (from Malcolm Rowe) help? (for SDK1.5, adapt it for 2.0)
Once you have a source JAR, you’d normally expect to just attach it directly to the library in Eclipse, but that doesn’t work with the Android SDK. Eclipse says:
“The JAR of this class file belongs to container ‘Android 1.5’ which does not allow modifications to source attachments on its entries.”
Which is a roundabout way of saying that the source path is fixed.
If you open up the Eclipse project properties dialog, change to theJava Build Path
page andLibraries
tab, then expand the ‘Android 1.5
’ library container and then theandroid.jar
file (phew!), you’ll see the ‘Source attachment
’ option, which shows where the source is expected to be.
For the Android 1.5 SDK, this is SDK
Location/platforms/android-1.5/sources
(and presumably similarly for the Android 1.1 target), where SDK Location is the path set in the ‘workspace preferences
’ Android page.
Note that the 1.0 SDK (which only supported the 1.0 target, of course) just appends the string sources to the SDK Location, on the assumption that the SDK location ended with a trailing slash. (This should only be something to look out for if you need to target 1.0; I’m pretty sure it was fixed in the plugin provided with the 1.1 SDK.)There are two ways to put the source JAR into the right place.
- The conventional way is to create a directory called sources/ under
platforms/android-1.5/
(or1.1
), and then unzip the JAR (which is just a ZIP file) into that directory.- However, although sources doesn’t have an extension, Eclipse doesn’t actually require it to be a directory, so a simpler way is just to rename your source JAR so that it’s called sources, and move it into the relevant directory.
Once you’ve moved the file or files into the right places, you just need to get Eclipse to take note of it. I found that just restarting Eclipse was enough, but if that doesn’t work you could always try refreshing the project, or closing and re-opening the project via the context menus.