tags:

views:

4885

answers:

8

I am using eclipse android plugins to build a project, But i am getting this error in the console window:

[2010-02-03 10:31:14 - androidVNC]Error generating final archive:
Debug certificate expired on 1/30/10 2:35 PM!

Does anyone know how to fix it?

+1  A: 

I had this problem couple of weeks ago. I first tried the troubleshooting on the Android developer site, but without luck. After that I reinstalled the Android SDK, which solved my problem.

Maurits Rijk
+27  A: 

Delete your debug certificate under ~/.android/debug.keystore (on Linux and Mac OS X); the directory is something like %USERHOME%/.androidon Windows.

The Eclipse plugin should then generate a new certificate when you next try to build a debug package.

Christopher
Perfect, that solved it for me.
Mike
On Windows I had to delete the debug.keystore and make some changes to get a new compile going. I created a new test project, and the new debug.keystore was generated.
Tomas
It will also be re-generated for the current project if you 'clean' the project (go to Project -> Clean...)
adamnfish
+4  A: 

Upon installation, the Android SDK generates a "debug" signing certificate for you in a keystore called debug.keystore. The Eclipse plug-in uses this certificate to sign each application build that is generated.

Unfortunately a debug certificate is only valid for 365 days. To generate a new one you must delete the existing debug.keystore file. Its location is platform dependent - you can find it in Preferences - Android - Build - Default debug keystore.

Jeff Gilfelt
A: 

I followed the instructions as in the other given answers to delete the debug.keystore file.

However, to have it regenerated, I needed to update my project properties to switch from one android sdk level to another. Simply editing code and building did not regenerate it, nor did closing and opening the project.

OldSnakey
You need to clean the project (Project -> Clean...)
adamnfish
+1  A: 

On Vista, this worked:

  1. DOS: del c:\user\dad\.android\debug.keystore

  2. ECLIPSE: In Project, Clean the project. Close Eclipse. Re-open Eclipse.

  3. ECLIPSE: Start the Emulator. Remove the Application from the emulator.

You are good to go.

I was pretty worried when I say that error, but I fixed it from reading here and playing around for 10 minutes.

jim
A: 

Thanks for great help, Now i have regenerted it and it's working fine. One important thing i would like to mention is Please restarrt the Eclipse even in windows Xp also.

kanak
A: 

H-m-m-m. Interesting how so many people have had slightly different experiences with this. I remember the days when this was considered a sign that the software was not ready for release, and the team would actually fix it BEFORE users started seeing these problems:(

My own experience was just a little different. I had already tried Project>Clean, but still got the same build failure. Then I deleted the debug.keystore (under .android) just as the first answer said. Still got the same problem. Then I did a clean again, and wonder of wonders, it worked!

Now don't get me wrong, I am glad that I got it working thanks to the hints in this thread. But clearly clean isn't working right, and how did it find an expired key after I deleted the keystore??? Clearly something is wrong with Eclipse or the ADT -- not so sure which.

Matt J.
A: 

It's a pain to have to delete all your development .apk files, because the new certificate doesn't match so you can't upgrade them in all your AVDs. You have to get another development MAP-API key as well. There's another solution.

You can create your own debug certificate in debug.keystore with whatever expiration you want. Do this in the .android folder under your HOME directory:

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 14000

ADT sets the first and last name on the certificate as "Android Debug", the organizational unit as "Android" and the two-letter country code as "US". You can leave the organization, city, and state values as "Unknown". This example uses a validity of 14000 days. You can use whatever value you like.

Dave MacLean