Android/Platform2011. 2. 10. 10:59

Error generating final archive: Debug certificate expired

어느날 갑자기 eclipse console에 위와 같이 "Debug certificate expired" 라는 문구가 뜬다면
사용하고 있던 debug.keystore 파일이 만료가 된 것이다. 파일 수명은 1년이다.

debug.keystore는 .android 폴더에 존재하고 있는데 다음과 같이 경로를 확인할 수 있다.
Eclipse - Window - Preferences



확인 하였으면 파일을 과감하게 삭제한다

파일을 삭제했는데도 왜 빌드가 안되냐..이러는 분들이 있는데,
eclipse의 Package Explore(workspace) 에 등록되어 있는 프로젝트들을 삭제하고 
다시 import를 하니 잘 되었다.

아래는 원문 참고..

Expiry of the Debug Certificate

The self-signed certificate used to sign your application in debug mode (the default on Eclipse/ADT and Ant builds) will have an expiration date of 365 days from its creation date.

When the certificate expires, you will get a build error. On Ant builds, the error looks like this:

debug:
[echo] Packaging bin/samples-debug.apk, and signing it with a debug key...
[exec] Debug Certificate expired on 8/4/08 3:43 PM

In Eclipse/ADT, you will see a similar error in the Android console.

To fix this problem, simply delete the debug.keystore file. The default storage location for AVDs is in ~/.android/ on OS X and Linux, in C:\Documents and Settings\\.android\ on Windows XP, and in C:\Users\\.android\ on Windows Vista.

The next time you build, the build tools will regenerate a new keystore and debug key.

Note that, if your development machine is using a non-Gregorian locale, the build tools may erroneously generate an already-expired debug certificate, so that you get an error when trying to compile your application. For workaround information, see the troubleshooting topic I can't compile my app because the build tools generated an expired debug certificate.



I can't compile my app because the build tools generated an expired debug certificate

If your development machine uses a locale that has a non-Gregorian calendar, you may encounter problems when first trying to compile and run your application. Specifically, you may find that the Android build tools won't compile your application because the debug key is expired.

The problem occurs because the Keytool utility — included in the JDK and used by the Android build tools — fails to properly handle non-Gregorian locales and may create validity dates that are in the past. That is, it may generate a debug key that is already expired, which results in the compile error.

If you encounter this problem, follow these steps to work around it:

  1. First, delete the debug keystore/key already generated by the Android build tools. Specifically, delete thedebug.keystore file. On Linux/Mac OSX, the file is stored in ~/.android. On Windows XP, the file is stored inC:\Documents and Settings\<user>\.android. On Windows Vista, the file is stored in C:\Users\<user>\.android
  2. Next, you can either
    • Temporarily change your development machine's locale (date and time) to one that uses a Gregorian calendar, for example, United States. Once the locale is changed, use the Android build tools to compile and install your app. The build tools will regenerate a new keystore and debug key with valid dates. Once the new debug key is generated, you can reset your development machine to the original locale.
    • Alternatively, if you do not want to change your machine's locale settings, you can generate the keystore/key on any machine using the Gregorian calendar, then copy the debug.keystore file from that computer to the proper location on your development machine.

This problem has been verified on Windows and may apply to other platforms.

For general information about signing Android applications, see Signing Your Applications.



-끝-
Posted by ekwang