[英]Activity.class - Class File Editor: The JAR file c:\sdk\platforms\android-17\android.jar has no source attachment
[英]The JAR file C:\sdk\platforms\android-18\android.jar has no source attachment. You can attach the source by clicking attach source below
我收到一條錯誤說明:
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.
首先確保您已經通過Android SDK Manager下載了項目中正在使用的Android版本的源文件: http : //developer.android.com/sdk/installing/adding-packages.html
然后右鍵單擊您的項目並選擇屬性,從左側菜單中選擇“Java Build Path”,選擇右側的“Libraries”選項卡,單擊以展開“Android XXX”,單擊以展開“android.jar”,然后然后雙擊“源附件:”項。
在彈出窗口中,選擇“外部位置”,單擊“外部文件夾”,然后瀏覽到適合之前選擇的“Android XXX”的android-sdk / sources / android-xx。 選擇確定以關閉對話框,您應該設置!
您需要附加第二個jar文件,其中包含給定庫的源代碼(.java)文件。 就像在ppeterka的評論中一樣,這通常會被命名為“android-src.jar”。 在您的示例中,您實際使用了不同版本的二進制jar文件,該文件不包含源文件。
專門用於獲取Android SDK源代碼,Android SDK Manager工具應該允許您輕松下載: http : //developer.android.com/sdk/installing/adding-packages.html
下載完成后,您需要找到正確的jar / zip文件的路徑並重新附加正確的源文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.