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\
on Windows XP, and in C:\Users\
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:
- First, delete the debug keystore/key already generated by the Android build tools. Specifically, delete the
debug.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 inC:\Users\<user>\.android
- 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.
-끝-
'Android > Platform' 카테고리의 다른 글
eclipse에서 android project 생성시 Build path contains duplicate entry 에러 해결. (2) | 2009.12.01 |
---|---|
msysgit을 이용하여 Window에서 Android Platform 소스 받기 (3) | 2009.10.16 |
Emulator - DDMS - Eclipse Debugger와의 연결 문제 (0) | 2009.09.24 |
Eclipse에서 Android Platform Source Build중 발생하는 Error 해결방법 (0) | 2009.09.23 |
Android SDK 1.6 설치 후 Emulator 구동시 발생하는 문제점들 해결 (0) | 2009.09.19 |