Eclipse中查看android工程代碼出現"android.jar has no source attachment"的解決方案_java

來源:互聯網
上載者:User

問題描述

Source not found

The JAR file D:\.....\sdk\platforms\android-17\android.jar has no source attachment.


提示就是找不到android.jar對應的source code

解決辦法:

由於我的工程建立時選擇的Target SDK 和 Compile with選項 均為android4.2.2,對應的api是17,因此就是eclipse找不到android api 17中的android.jar的原始碼。
1. 使用SDK Manager下載4.2.2版本的Sources for Android SDK



找到
D:/adt-bundle-windows-x86_64-20130522/sdk/sources/android-17
點擊OK後原始碼就顯示出來了

================

2013.10.9更新:

可能是使用了android4.3(API 18)新的api,今天使用Eclipse/ADT Bundle出現了

the source attachment does not contain the source for the file *.class 的問題,而指定的原始碼目錄是沒有問題的,問題竟然是編碼問題。

上圖中的Encoding選項修改為UTF-8,問題解決。

以上就是本文的全部內容,希望對大家的學習有所協助。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.