Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant fails to build signed apk after updating to android v20

Quite a bit of weird error is happening after I upgraded android and eclipse tools to v20

building through Ant stopped working with the following error upon creating the signed apk

 BUILD FAILED
 C:\Programs\Android\tools\ant\build.xml:1097: The following error occurred while executing this line:
 C:\Programs\Android\tools\ant\build.xml:1109: Cannot recover key

Any idea what could've changed when doing the upgrade to android JB components, and how can this be rectified?

I appreciate any help...

like image 206
Nar Gar Avatar asked Jul 24 '12 06:07

Nar Gar


2 Answers

We have had the same problem, and we have a solution but not really an explanation!

Our existing builds had the following in properties files:

  • key.store=COMPANY_NAME-key.keystore
  • key.alias=COMPANY_NAME
  • key.store.password=KEY_STORE_PASSWORD
  • key.alias.password=KEY_ALIAS_PASSWORD

But this has stopped working – however when we change the key.alias.password to match the store password it is working eg:

  • key.store=COMPANY_NAME-key.keystore
  • key.alias=COMPANY_NAME
  • key.store.password=KEY_STORE_PASSWORD
  • key.alias.password=KEY_STORE_PASSWORD

Alias not sure why, perhaps someone has mucked up the ant library?

like image 58
TeazelDev2 Avatar answered Oct 21 '22 21:10

TeazelDev2


I just spent about 5hr on this topic... It all came down to a space after the password.

Apparently in the prior version it was trimming the password and in the current version it does not.

So making sure you don't have spaces at the end of the lines might make the difference. That solved the problem for us - no need to go to JDK7 (although it seems to build and work just fine anyway, at least from ant).

like image 3
Roberto C Serrano Avatar answered Oct 21 '22 22:10

Roberto C Serrano