“调试证书已过期” 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!
如何修复它?
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!
How do I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(18)
在 Linux 和 Mac OS X 上删除
~/.android/debug.keystore
下的调试证书;该目录类似于 Windows 上的%USERPROFILE%/.android
。当您下次尝试构建调试包时,Eclipse 插件应该会生成一个新证书。您可能需要清理然后构建才能生成证书。
Delete your debug certificate under
~/.android/debug.keystore
on Linux and Mac OS X; the directory is something like%USERPROFILE%/.android
on Windows.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.
安装后,Android SDK 会在名为
debug.keystore
的密钥库中为您生成一个debug
签名证书。 Eclipse 插件使用此证书对生成的每个应用程序构建进行签名。不幸的是,调试证书的有效期只有 365 天。要生成新的,您必须删除现有的
debug.keystore
文件。它的位置取决于平台 - 您可以在首选项 - Android - 构建 - 默认调试密钥库中找到它。Upon installation, the Android SDK generates a
debug
signing certificate for you in a keystore calleddebug.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.必须删除所有开发 .apk 文件是一件很痛苦的事情,因为新证书不匹配,因此您无法在所有 AVD 中升级它们。您还必须获得另一个开发 MAP-API 密钥。还有另一个解决方案。
您可以在
debug.keystore
中创建您自己的调试证书,无论您想要什么过期时间。在HOME
目录下的.android
文件夹中执行此操作:keytool.exe
可以在 JDK bin 文件夹中找到(例如C Windows 上的:\Program Files\Java\jdk1.6.0_31\bin\
)。ADT 将证书上的名字和姓氏设置为“Android Debug”,组织单位设置为“Android”,两个字母的国家/地区代码设置为“US”。您可以将组织、城市和州值保留为“未知”。本示例使用的有效期为 14000 天。您可以使用任何您喜欢的值。
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 yourHOME
directory:keytool.exe
can be found in the JDK bin folder (e.g.C:\Program Files\Java\jdk1.6.0_31\bin\
on 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.
在 Vista 上,这有效:
DOS:
del c:\user\dad\.android\debug.keystore
ECLIPSE:在项目中,清理项目。关闭日食。重新打开 Eclipse。
ECLIPSE:启动模拟器。从模拟器中删除应用程序。
你可以走了。
当我说这个错误时我非常担心,但我通过阅读这里并玩了 10 分钟修复了它。
On Vista, this worked:
DOS:
del c:\user\dad\.android\debug.keystore
ECLIPSE: In Project, Clean the project. Close Eclipse. Re-open Eclipse.
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.
删除:debug.keystore
位于
C:\Documents and Settings\\[user]\.android
,清理并构建您的项目。转到
C:\Users\[用户名]\.android
并删除 debug.keystore 文件。清理并构建您的项目。
删除位于
~/.android/debug.keystore
中的密钥库 清理并构建您的项目。在所有选项中,如果您无法获取新的 debug.keystore,只需重新启动 eclipse。
Delete: debug.keystore
located in
C:\Documents and Settings\\[user]\.android
, Clean and build your project.go to
C:\Users\[username]\.android
and delete debug.keystore file.Clean and build your project.
Delete your keystore located in
~/.android/debug.keystore
Clean and build your project.In all the options if you can´t get the new debug.keystore just restart eclipse.
在 Windows 7 中,它位于路径中
debug.keystore
In Windows 7 it is at the path
debug.keystore
如果项目调试过程中证书过期,则必须手动卸载:
请执行
在 shell 中
adb uninstall
。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.在 Mac 上,打开终端(应打开当前用户的目录),cd“.android”(“ls”以验证 debug.keystore 是否存在)。最后“rm debug.keystore”删除该文件。
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.
Android SDK 在名为
debug.keystore
的密钥库中为您生成一个“调试”签名证书。Eclipse 插件使用此证书对生成的每个应用程序版本进行签名。不幸的是,调试证书的有效期只有 365 天。要生成新的,您必须删除现有的
debug.keystore
文件。它的位置取决于平台 - 您可以在首选项中找到它 -> Android -> 构建 -> *默认调试密钥库。如果您使用的是 Windows,请按照以下步骤操作。
DOS:del c:\user\dad.android\debug.keystore
Eclipse:在项目中,清理项目。关闭日食。重新打开 Eclipse。
Eclipse:启动模拟器。从模拟器中删除应用程序。
如果您使用的是 Linux 或 Mac,请按照以下步骤操作。
从
.android
文件夹中手动删除debug.keystore
。您可以像这样找到
.android
文件夹:home/username/.android
注意:默认的
.android
文件将被隐藏。因此,单击地点菜单。在选择主文件夹下。在单击“查看”下,单击“显示隐藏文件”,然后
.android
文件夹将可见。从
.android 文件夹
中删除debug.keystore
。然后清理你的项目。现在Android将生成一个新的
.android文件夹
文件。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.If you are using Windows, follow the steps below.
DOS: del c:\user\dad.android\debug.keystore
Eclipse: In Project, Clean the project. Close Eclipse. Re-open Eclipse.
Eclipse: Start the Emulator. Remove the Application from the emulator.
If you are using Linux or Mac, follow the steps below.
Manually delete
debug.keystore
from the.android
folder.You can find the
.android
folder like this:home/username/.android
Note: the default
.android
file will be hidden.So click on the places menu. Under select home folder. Under click on view, under click show hidden files and then the
.android
folder will be visible.Delete
debug.keystore
from the.android folder
.Then clean your project. Now Android will generate a new
.android folder
file.几周前我遇到了这个问题。我首先在 Android 开发者网站上尝试了故障排除,但没有成功。之后我重新安装了Android SDK,这解决了我的问题。
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.
嗯。有趣的是,这么多人对此的经历略有不同。我记得当时这被认为是软件尚未准备好发布的标志,并且团队实际上会在用户开始看到这些问题之前修复它:(
我自己的经历有点不同。我已经尝试过 Project>Clean ,但仍然遇到相同的构建失败。然后我删除了 debug.keystore (在 .android 下),就像第一个答案所说的那样。然后我再次进行了清理,奇迹中的,它
现在 起作用了!不要误会我的意思,我很高兴由于该线程中的提示而使其正常工作,但显然 clean 无法正常工作,并且在我删除密钥库后它是如何找到过期密钥的??? Eclipse 或 ADT 有问题——不太确定是哪一个。
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.
在 Ubuntu 上,这有效:
我转到
home/username/.android
并将keystore.debug
重命名为keystoreold.debug
。然后我关闭 Eclipse,启动 Eclipse,SDK 在该文件夹中创建了新证书keystore.debug
。然后,您必须卸载/重新安装通过 USB 调试或未签名的 APK(“未签名”APK = 使用调试证书签名)安装的应用程序。
On Ubuntu, this worked:
I went to
home/username/.android
and I renamedkeystore.debug
tokeystoreold.debug
. I then closed Eclipse, started Eclipse, and SDK created new certificatekeystore.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).
首先关闭 eclipse,然后
通过 Window Key + R 或通过 以管理员身份运行 打开 CMD
执行以下步骤。
重新启动 eclipse 后
First close the eclipse then
Open CMD by Window Key + R or via Run as Admin
Follows the following step
after this restart eclipse.
对于 Windows XP,请转到
C:\Documents and Settings\%userprofile%\.android
并删除 debug.keystore 文件,重新启动 Eclipse,现在您的项目将正确构建。示例路径:
阅读此处了解更多。
For windows xp go to
C:\Documents and Settings\%userprofile%\.android
and delete debug.keystore file, restart the eclipse and now your project get build without error.Example path:
read-here-for-more.
在 Windows 中,
debug.keystore
文件位于C:\Users\%Username%\.android
文件夹中。该文件是在您安装 Android SDK 时创建的,有效期仅一年。在此期间之后,您将开始收到此错误获取最终存档时出错:调试证书已于 xx/xx/xxxx 过期
。要消除此错误,只需删除该文件并再次运行该程序即可。在我的 Eclipse 中,我启用了
Project->Build Automatically
,因此它可以直接工作,但如果您禁用它,则需要清理项目Project->Clean
。 . 选择您的项目并按确定。然后你需要手动构建它。第三次单击您的项目并选择构建项目
。(注意 - 如果您在项目菜单中禁用了自动构建功能,您只会看到此选项)In Windows
debug.keystore
file is localtes atC:\Users\%Username%\.android
folder. This file is created when you install your android SDK and is valid only for a year. After this perod you will start getting this errorError getting final archive: Debug certificate expired on xx/xx/xxxx
.To remove this error simply delete the file and run the program again. In my Eclipse I have enabled
Project->Build Automatically
so it directly worked but in case you have disabled it you will need to clean the projectProject->Clean
.. select your project and press ok. Then you will need to build it manually. 3rd click on your project and selectBuild project
.(Note - You will only see this option if you have diabled Build Automatically feature in your Projects Menu)在 Eclipse 中安装 Android SDK 后,它会在名为 debug.keystore 的密钥库中为您生成一个调试签名证书。 Eclipse 插件使用此证书对生成的每个应用程序构建进行签名。
现在,这个调试证书的问题是它的有效期只有一年,即 365 天。
如果您的 Eclipse IDE 使用过期的调试证书,您将无法创建和/或部署 Android 应用
。要解决此问题,您所需要做的就是删除 debug.keystore 文件。
转到首选项
Android
构建
默认调试密钥库
您应该在其中看到该文件所在的文件夹。只需删除该文件即可。
欲了解更多信息。你可以访问
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.
Go to Preferences
Android
Build
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
要解决此问题,只需删除 debug.keystore 文件即可。
AVD 的默认存储位置是
另请参阅此链接,它可能会有所帮助。
http://developer.android.com/tools/publishing/app-signing.html
To fix this problem, simply delete the debug.keystore file.
The default storage location for AVDs is
Also see this link, which can be helpful.
http://developer.android.com/tools/publishing/app-signing.html
删除位于
C:\Users\%Username%\.android
文件夹中的 debug.keystore。然后运行该应用程序。它将生成新的。Delete the debug.keystore located at
C:\Users\%Username%\.android
folder. Then run the app. It will generate the new one.