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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2194808/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 04:53:42  来源:igfitidea点击:

"Debug certificate expired" error in Eclipse Android plugins

androideclipsecertificate

提问by hap497

I am using Eclipse Android plugins to build a project, but I am getting this error in the console window:

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

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

How do I fix it?

我如何解决它?

回答by Christopher Orr

Delete your debug certificate under ~/.android/debug.keystoreon Linux and Mac OS X; the directory is something like %USERPROFILE%/.androidon Windows.

~/.android/debug.keystoreLinux 和 Mac OS X下删除您的调试证书;该目录类似于Windows%USERPROFILE%/.android上的目录。

The Eclipse plugin should then generate a new certificate when you next try to build a debug package. You may need to clean and then build to generate the certificate.

当您下次尝试构建调试包时,Eclipse 插件应该会生成一个新证书。您可能需要清理然后构建以生成证书。

回答by Jeff Gilfelt

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

安装后,Android SDKdebug会在名为 的密钥库中为您生成签名证书debug.keystore。Eclipse 插件使用此证书对生成的每个应用程序构建进行签名。

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

不幸的是,调试证书的有效期仅为 365 天。要生成新debug.keystore文件,您必须删除现有文件。它的位置取决于平台 - 您可以在Preferences-Android-Build-Default debug keystore 中找到它。

回答by Dave MacLean

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.

必须删除所有开发 .apk 文件很痛苦,因为新证书不匹配,因此您无法在所有 AVD 中升级它们。您还必须获得另一个开发 MAP-API 密钥。还有另一种解决方案。

You can create your own debug certificate in debug.keystorewith whatever expiration you want. Do this in the .androidfolder under your HOMEdirectory:

您可以创建自己的调试证书,debug.keystore只要您想要过期。.android在您HOME目录下的文件夹中执行此操作:

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

keytool.execan be found in the JDK bin folder (e.g. C:\Program Files\Java\jdk1.6.0_31\bin\on Windows).

keytool.exe可以在 JDK bin 文件夹中找到(例如C:\Program Files\Java\jdk1.6.0_31\bin\在 Windows 上)。

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.

ADT 将证书上的名字和姓氏设置为“Android Debug”,组织单位为“Android”,两个字母的国家/地区代码为“US”。您可以将组织、城市和州值保留为“未知”。此示例使用 14000 天的有效期。您可以使用任何您喜欢的值。

回答by Dave MacLean

On Vista, this worked:

在 Vista 上,这有效:

  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.

  1. 操作系统: del c:\user\dad\.android\debug.keystore

  2. ECLIPSE:在项目中,清理项目。关闭日食。重新打开 Eclipse。

  3. ECLIPSE:启动模拟器。从模拟器中删除应用程序。

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.

当我说那个错误时,我非常担心,但我通过阅读这里并玩了 10 分钟来修复它。

回答by Jorgesys

  • WINDOWS
  • 视窗

Delete: debug.keystorelocated in C:\Documents and Settings\\[user]\.android, Clean and build your project.

删除:debug.keystore位于 C:\Documents and Settings\\[user]\.android,清理并构建您的项目。

  • Windows 7go to C:\Users\[username]\.androidand delete debug.keystore file.
  • Windows 7转到C:\Users\[username]\.android并删除 debug.keystore 文件。

Clean and build your project.

清理并构建您的项目。

  • MAC
  • 苹果电脑

Delete your keystore located in ~/.android/debug.keystoreClean and build your project.

删除位于~/.android/debug.keystoreClean 中的密钥库并构建您的项目。

In all the options if you can′t get the new debug.keystore just restart eclipse.

在所有选项中,如果您无法获得新的 debug.keystore,只需重新启动 eclipse。

回答by AZ_

In Windows 7 it is at the path

在 Windows 7 中,它位于路径上

C:\Users\[username]\.android
  • goto this path and remove debug.keystore
  • clean and build your project.
  • 转到此路径并删除 debug.keystore
  • 清理并构建您的项目。

回答by Solata

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.

adb uninstall <package_name>在shell中执行 。

回答by Michael Biermann

On a Mac, open the Terminal (current user's directory should open), cd ".android" ("ls" to validate debug.keystore is there). Finally "rm debug.keystore" to remove the file.

在 Mac 上,打开终端(应该打开当前用户的目录),cd“.android”(“ls”来验证 debug.keystore 是否存在)。最后“rm debug.keystore”删除文件。

回答by sravan

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.

Android SDK 在名为 的密钥库中为您生成“调试”签名证书debug.keystore。Eclipse 插件使用此证书对生成的每个应用程序构建进行签名。

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

不幸的是,调试证书的有效期仅为 365 天。要生成新debug.keystore文件,您必须删除现有文件。它的位置取决于平台 - 您可以在Preferences-> Android-> Build-> *Default debug keystore 中找到它。

If you are using Windows, follow the steps below.

如果您使用的是 Windows,请按照以下步骤操作。

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

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

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

Eclipse:在项目中,清理项目。关闭日食。重新打开 Eclipse。

Eclipse: Start the Emulator. Remove the Application from the emulator.

Eclipse:启动模拟器。从模拟器中删除应用程序。

If you are using Linux or Mac, follow the steps below.

如果您使用的是 Linux 或 Mac,请按照以下步骤操作。

Manually delete debug.keystorefrom the .androidfolder.

debug.keystore.android文件夹中手动删除。

You can find the .androidfolder like this: home/username/.android

你可以找到这样的.android文件夹:home/username/.android

Note: the default .androidfile will be hidden.

注意:默认.android文件将被隐藏。

So click on the places menu. Under select home folder. Under click on view, under click show hidden files and then the .androidfolder will be visible.

所以点击地点菜单。在选择主文件夹下。在单击查看下,在单击显示隐藏文件下,然后该.android文件夹将可见。

Delete debug.keystorefrom the .android folder.

删除debug.keystore.android folder

Then clean your project. Now Android will generate a new .android folderfile.

然后清理你的项目。现在Android 将生成一个新.android folder文件。

回答by Maurits Rijk

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

几周前我遇到了这个问题。我首先在 Android 开发人员网站上尝试了故障排除,但没有运气。之后我重新安装了Android SDK,解决了我的问题。