com.android.sdklib.build.ApkCreationException: Debug Certificate expired 

Joined:
07/27/2010
Posts:
130

August 31, 2011 15:49:54    Last update: August 31, 2011 15:49:54
Got this error while trying to build Android app:
[apkbuilder] Creating AppInfo-debug-unaligned.apk and signing it with a debug key...

BUILD FAILED
/home/freyo/android-sdk-linux_86/tools/ant/main_rules.xml:520: The following error occurred while executing this line:
/home/freyo/android-sdk-linux_86/tools/ant/main_rules.xml:236: com.android.sdklib.build.ApkCreationException: Debug Certificate expired on 8/26/11 5:15 PM
	at com.android.sdklib.build.ApkBuilder.getDebugKey(ApkBuilder.java:277)
	at com.android.sdklib.build.ApkBuilder.<init>(ApkBuilder.java:384)
	at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:247)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)


Solution:
  1. Delete the Android debug keystore:
    $ rm ~/.android/debug.keystore 
    

  2. Build again:
    $ ant debug
    

  3. The new key is valid for 30 years (keystore password is 'android'):
    $ keytool -list -v -keystore ~/.android/debug.keystore 
    Enter keystore password:  
    
    Keystore type: JKS
    Keystore provider: SUN
    
    Your keystore contains 1 entry
    
    Alias name: androiddebugkey
    Creation date: Aug 31, 2011
    Entry type: PrivateKeyEntry
    Certificate chain length: 1
    Certificate[1]:
    Owner: CN=Android Debug, O=Android, C=US
    Issuer: CN=Android Debug, O=Android, C=US
    Serial number: 4e5e9c7c
    Valid from: Wed Aug 31 16:41:32 EDT 2011 until: Fri Aug 23 16:41:32 EDT 2041
    Certificate fingerprints:
    	 MD5:  38:D0:5B:3A:9F:DC:EE:02:0D:47:FC:A4:A3:43:38:17
    	 SHA1: D1:F6:4D:39:31:B0:B6:70:A4:83:D3:51:7E:FF:3B:13:49:46:13:2E
    	 Signature algorithm name: SHA1withRSA
    	 Version: 3
    
    
    *******************************************
    *******************************************
    

Share |
| Comment  | Tags