Wednesday, July 20, 2011

Android Debug Certificate Expired Problem

Are you aware that Android debug certificate is only valid for one year/365 days? After your certificate’s expired, you’ll see the following error message while compiling android application.
Error generating final archive:
Debug certificate expired on 7/15/11 7:00 PM!


You need to generate a new keystore to fix that error
1) Delete the current keystore
You can find the location of keystore in Eclipse (Preferences -> Android -> Build -> Default Debug keystore). It should be under ~/.android/debug.keystore (Linux and Mac OS X) and %USERHOME%/.android (Windows).
2) In Eclipse, Clean the project (Project -> Clean )
3) Close Eclipse and reopen Eclipse
Eclipse will generate a new keystore when you try to build your application.

Another way is you can create your own certificate with this command.

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity [days]