1. 程式人生 > >入門學習1:Debug Certificate expired 解決辦法

入門學習1:Debug Certificate expired 解決辦法

問題概述:

在匯入一個app後提示如下錯誤:

“Error generating final archive: Debug Certificate expired on 10/09/18 16:30”

原因分析:

android要求所有的程式必須有簽名,否則就不會安裝該程式。在我們開發過程中,adt使用debug keystore,在 preference->android->buid中設定。debug的keystore預設有效期為一年,如果你是從一年前開始完android程式,那麼在一年後匯入這個app的時候很可能出現debug keystore過期,導致你無法生成 apk檔案。

此時你只要刪除debug keystore就行,系統又會為你生成有效期為一年的私鑰。 

解決方法:

進入C:\Documents and Settings\Administrator\.android 刪除路徑下的debug.keystore及 ddms.cfg。

(不同環境下的目錄可能略有不同,可在eclipse中查詢此路徑:Window->Preferences->Android->Build下 Default debug keystore)

然後重新匯入即可。