Skip to content

Android Error – Debug Certificate Expired

Android project suddenly shows a red cross after a year? Your debug certificate has expired. Learn how to fix it by deleting debug.keystore in Eclipse.

Ramón Invarato

One day our project works perfectly, and the next day it shows a red cross. This happens when we’ve been working on the same project for exactly one year. What’s going on is that our certificate has expired, since it’s only valid for one year.

We can see the following error in the “Problems” view:

Error generating final archive: Debug Certificate expired on xx/zz/yy hh:mm

Screenshot of Eclipse's Problems view showing the error: Debug Certificate expired while generating the final archive

Solution

To fix it, we check where the "debug.keystore" is installed in "Windows / Preferences".

Screenshot of Eclipse's Window menu with the Preferences option highlighted

In the sidebar on the right, we select "Android / Build" and look at the path where the keystore is located in "Default debug keystore".

Screenshot of Preferences under Android > Build with the Default debug keystore path highlighted

With Eclipse closed, we go to our user folder in Windows and then to the “.android” folder. We find “debug.keystore” and delete it.

Screenshot of the .android folder with the debug.keystore file highlighted, to be copied to the new computer

When we restart Eclipse, it will generate a new one that will last another year.

But now you’ll get a different error when you try to run an APK (app) on the emulator where it was previously installed with the old certificate. See the error: Different certificate when trying to reinstall the app on the emulator.

“Android Error – Debug Certificate Expired” by Ramón Invarato at jarroba.com, licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0. Registered at Safe Creative.

Ramón Invarato

I design and build data platforms and intelligent systems, and I enjoy sharing that experience here.

You may also like

Comments

Leave a comment


This site uses Akismet to reduce spam. Learn how your comment data is processed.