Android開發時提示Your project contains error(s),please fix them be

來源:互聯網
上載者:User

標籤:android   style   blog   http   color   使用   io   strong   

有次在使用eclipse寫好Android的代碼,代碼沒有報錯。然後

想在AVD中運行測試時,總是會彈出錯誤框,提示資訊為:  “ Your project contains error(s),please fix them before running your application.” 
 不管是重啟AVD 重啟eclipse 甚至建立一個新的Android工程項目都不能運行 

有幾種原因:

1.在不同的電腦下開發,而且檔案存放路徑不同,錯誤的主要原因是  “.classpath” 檔案的載三方類庫包路徑錯誤。

2.也可能是你的SDK版本不存在或者沒有。

3.編譯的class、apk檔案有問題:執行清除一下就可以了。Project→Clean→Clena Projects Selected Below選擇你出錯的項目就可以了。

4.有可能就是最重要的這一點:在Program提示框中會提示:“Error generating final archive: Debug Certificate expired on12-7-25 下午7:52” 原因分析: android要求所有的程式必須有簽名,否則就不會安裝該程式。在我們開發過程中,adt使用debug keystore,在preference->android->buid中設定。debug的keystore預設有效期間為一年,如果你是從一年前開始完android程式,那麼在一年後匯入這個app的時候很可能出現debugkeystore到期,導致你無法產生apk檔案。 此時你只要刪除debugkeystore就行,系統又會為你產生有效期間為一年的私密金鑰。   解決方案: 進入C:\Documents and Settings\Administrator\.android刪除路徑下的debug.keystore及ddms.cfg。 (不同環境下的目錄可能略有不同,可在eclipse中尋找此路徑:Window->Preferences->Android->Build下Default debug keystore) 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.