天天看點

Error generating final archive: Debug certificate expired on XXXX 時間的解決辦法

錯誤描述:

Eclipse 編譯 Android工程時,提示該錯誤 :Error generating final archive: Debug certificate expired on 11-10-20 下午 12:20

原因分析:

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

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

解決方法:

在Eclipse菜單Window -> Preferences -> Android -> Build,找到那個Default debug keystore顯示的路徑,

然後删除該路徑下的debug.keystore檔案後,然後clean工程,重新編譯即可。

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

繼續閱讀