Saturday, November 14, 2009

Tip: Dealing With Expired Debug Certificates


If you've been developing on Android for a while, you'll eventually see this error (or something like it):


Error generating final archive: Debug certificate expired on 11/3/09 8:59 AM!

This will happen once a year. The default debug certificate is set to have just a one year expiry. The easy solution is to simply delete the debug.keystore file and let the SDK generate a new one the next time you build.

Why not create one that won't expire after a year, though? This command will do just that:


keytool -genkey -keypass android -keystore debug.keystore -alias androiddebugkey -storepass android -validity 10000 -dname "CN=Android Debug,O=Android,C=US"

Run this from wherever the debug.keystore file needs to be generated and you'll get 10,000 days before needing to deal with this again, instead of merely 365.

6 comments:

SteveT said...

Thanks! This was very helpful.

SteveT said...

Thanks! This was very helpful.

Amol said...

Thanks a lot

Amol said...

Thanks a lot

ivylicious said...

thanks :) great help indeed :)

Mr Lindo said...

Thanks for the help,