Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The JAR file C:\sdk\platforms\android-18\android.jar has no source attachment. You can attach the source by clicking attach source below

Tags:

java

eclipse

I'm getting an error stating:

The JAR file C:\sdk\platforms\android-18\android.jar has no source attachment. You can attach the source by clicking attach source below.

However I've clicked the attach source button and added C:\sdk\platforms\android-17\android.jar and then it simply gives me:

Source not found. The source attachment does not contain the source for the file Activity.class. You can change the source attachment by clicking Change Attached Source below.
like image 683
HelloMojo Avatar asked Dec 07 '22 05:12

HelloMojo


1 Answers

First make sure that you've downloaded the source files for the version of android that you're using in the project via the Android SDK Manager: http://developer.android.com/sdk/installing/adding-packages.html

Then right-click on your project and choose properties, pick "Java Build Path" from the left menu, pick the "Libraries" tab on the right, click to expand "Android X.X.X", click to expand "android.jar", and then double-click the "Source attachment:" item.

In the pop-up, choose the "External Location", click "External Folder", and browse to your android-sdk/sources/android-xx that is appropriate for the "Android X.X.X" selected earlier. Choose OK to close the dialogs, and you should be set!

like image 102
inman320 Avatar answered May 24 '23 14:05

inman320