Eclipse Android 插件中的“调试证书已过期”错误

我正在使用 Eclipse Android 插件来构建一个项目,但我是 在控制台窗口中出现此错误:

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

我该如何解决?

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.

In Windows 7 it is at the path

C:\Users\[username]\.android
  • goto this path and remove debug.keystore
  • clean and build your project.

If a certificate expires in the middle of project debugging, you must do a manual uninstall:

Please execute adb uninstall <package_name> in a shell.

On Ubuntu, this worked:

I went to home/username/.android and I renamed keystore.debug to keystoreold.debug. I then closed Eclipse, started Eclipse, and SDK created new certificate keystore.debug in that folder.

You then have to uninstall/reinstall apps you installed via USB Debugging or an unsigned APK ("unsigned" APK = signed with debug certificate).

First close the eclipse then

Open CMD by Window Key + R or via Run as Admin

Follows the following step

del "%USERPROFILE%\.android\debug.keystore"
keytool -genkey -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 30000

after this restart eclipse.

After you install the Android SDK in Eclipse, it 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.

Now, the problem with this debug certificate is that it is only valid for a year, or 365 days. If your Eclipse IDE uses an expired debug certificate, you will not be able to create and/or deploy an Android app.

To fix this problem all you need to do is delete the debug.keystore file.

  1. Go to Preferences
  2. Android
  3. Build
  4. Default debug keystore

There you should see the folder where the file is located. Simply delete that file and you are good to go.

For more info. you can visit

http://developer.android.com/tools/publishing/app-signing.html

To fix the problem, you need to generate a new debug certificate. For this to be done, the existing debug.keystore file should be deleted.

Once the old certificate is deleted, the Eclipse plugin should generate a new certificate when we try to build a debug package. It would be a good idea to clean and then build the package for certificate generation.

To delete your debug certificate:

Linux & MacOS:

delete the debug.keystore file from ~/.android/debug.keystore

Windows:

C:\Users\YourUserName\.android\debug.keystore