4

次のようなエラーが表示されます。

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

ただし、ソースの添付ボタンをクリックして C:\sdk\platforms\android-17\android.jar を追加すると、次のようになります。

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.
4

2 に答える 2

15

最初に、プロジェクトで使用している Android のバージョンのソース ファイルを Android SDK Manager 経由でダウンロードしたことを確認します: http://developer.android.com/sdk/installing/adding-packages.html

次に、プロジェクトを右クリックしてプロパティを選択し、左側のメニューから [Java ビルド パス] を選択し、右側の [ライブラリ] タブを選択し、[Android XXX] をクリックして展開し、[android.jar] をクリックして展開します。次に、「Source attachment:」項目をダブルクリックします。

ポップアップで「外部の場所」を選択し、「外部フォルダー」をクリックして、先ほど選択した「Android XXX」に適した android-sdk/sources/android-xx を参照します。[OK] を選択してダイアログを閉じれば、設定は完了です。

于 2013-11-25T19:36:10.470 に答える