Recently I used eclipse to develop an android program and found that the following error was reported when I checked the android sdk source code:
Source not found
The JAR of this class file belongs to container 'android 2.0 'which does not allow modification to source attachments on its entries
The general SDK does not contain the source code, so you need to download it online.
repo init -u git://android.git.kernel.org/platform/manifest.git
repo sync
(Www.android.git.kernel.org is the android source code website)
I was sorted out from the Internet ready-made download, the version is android 2.0, this is: http://download.csdn.net/source/1873037
1. Create a new folder named sources under the folder of the corresponding version number (this name must be used)
For example: android-sdk-linux_x86/platforms/android-2.0/sources
2. Place the downloaded source file in the sources folder.
3. Restart eclipse
In this way, you can view the source code.
Article about solving: http://android.opensourceror.org/2010/01/18/android-source/
Http://blog.michael-forster.de/2008/12/view-android-source-code-in-eclipse.html
Http://stuffthathappens.com/blog/2008/11/01/browsing-android-source-in-eclipse/
PS: start my project is built on Android-2.2, in order to add the source code, self blind in android-sdk-linux_x86/platforms/Android-8/, the results lead to engineering errors, the error is as follows:
Android. Hello. helloactivity does not extend Android. App. Activity androidmanifest. xml/Hello Line 8
I don't know why, and now I don't want to take the time to check it, so I changed the project to 2.0.