Eclipse中编译Android工程时,提示错误 :Error generating final archive: Debug certificate expired on xxxxxx(日期)

解决办法:
进入:C:/Documents and Settings/USER(用户账户)/.android ,删除:debug.keystore和ddms.cfg


English blog

Once in a while the SDK shows some hickups – usually easy to solve. As this one. Today i got this error message “Error generating final archive: Debug certificate expired on …” while building an apk file inside Eclipse to be run in the emulator on a machine which has not been used for a while.

If you are using IntelliJ 9 with the Android plugin the error message looks like this:

Well, the idea to just update all components to the current state and then to compile a project to check it out on this backup development system went from a 10 min cruise to the unexpected question “Whats wrong?”.

Looking at the error message it was clear that the build process wanted to use a certificate which timed out. The Android SDK is using certificates to sign all the apk files even ther files which run in the emulator (fair enough). The cert is usually valid for just 365 days which means that you get the same error next time shortly after forgetting how you’d solve it last time.

The simple solution is to just delete the file “debug.keystore ” which is stored in your home directory under “~/.android ” (OSX, Linux). A Windows Vista/7 user will find the file in the “C:/Users/<user</.android folder.

After deleting the file just “clean” your project and build int from scratch and the error should be gone.

To prevent this brain training procedure for a while a decided to generate a key which lasts 1000 days instead of just the full year. Startup the OSX terminal app or the Linux terminal and go to the “.android” folder. Delete the old certificate file first. Then issue the following command from the command line:

keytool -genkey -keypass android -keystore debug.keystore -alias androiddebugkey -storepass android -validity 1000 -dname “CN=Android Debug,O=Android,C=US”

Now there should be a new certificate file sitting in the folder which lasts 1000 days – enough to really forget how you solved this issue last tim

更多相关文章

  1. Android(安卓)NDK编程浅入深出之--了解NDK
  2. 向android studio导入android源生app
  3. 开发Android第四步,Android(安卓)NDK 及 android gcc toolchain
  4. Android的源代码结构
  5. android makefile prebuild
  6. Android(安卓)APK反编译详解(附图)
  7. (Android)搭建NDK开发环境 (一)
  8. Android(安卓)自动编译、打包生成apk文件 2 - 使用原生Ant方式
  9. 系出名门Android(9) - 数据库支持(SQLite),

随机推荐

  1. PHP本地环境搭建|PHP运行原理|PHP与html
  2. ListView的两次测量(源码分析)
  3. 传谷歌年底推Android眼镜:可返回实时信息
  4. Firefox for Honeycomb 推出测试版,你有兴
  5. Android(安卓)键盘监控的实现原理及过程
  6. 图解 Android(安卓)广播机制
  7. Android:一个高效的UI才是一个拉风的UI(二)
  8. [Android]你不知道的Android进程化(1)--
  9. 你如何评价Android系统?优缺点
  10. 谷歌要求马上升级!Android迎来安全更新:修