Problem description
Source not found
The JAR file D:/.../sdk/platforms/android-17/android.jar has no source attachment.
The prompt is that the source code corresponding to android.jar cannot be found
Solution:
Since the Target SDK and Compile with options selected when I created the project are Android 4.2.2, and the corresponding API is 17, eclipse cannot find the source code of Android.jar in Android API 17.
1. Use SDK Manager to download the 4.2.2 version of Sources for Android SDK
The directory after downloading using this machine as an example is:
D:/adt-bundle-windows-x86_64-20130522/sdk/sources/android-17
2. Add source code
Click the Attach Source... button in the error window, and then
turn up
D:/adt-bundle-windows-x86_64-20130522/sdk/sources/android-17
After clicking OK, the source code will be displayed
======================
Updated on 2013.10.9:
Maybe it's using the new API of Android 4.3 (API 18), and today it appears using Eclipse/ADT Bundle
The source attachment does not contain the source for the file *.class problem, and the specified source code directory is no problem, the problem is actually a coding problem.
The Encoding option in the above figure is changed to UTF-8, and the problem is solved.
The above is all about this article, I hope it will be helpful to everyone's learning.