Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cordova can't build release anymore

I'm using Cordova v8 with android v7 I can build a debug build without issue but release build now breaks. I've tried to remove/add android, recreating the project, nothing does it. I'm using a build.json and it used to work perfectly, and do

 cordova build android --release

Here is the error

FAILURE: Build failed with an exception.
* Where:
Script 
'D:\myapp\platforms\android\CordovaLib\cordova.gradle' line: 147

* What went wrong:
Failed to create component for 'dialog' reason: java.awt.HeadlessException
> java.awt.HeadlessException (no error message)

How can I fix this??? I've tried this solution without success...

like image 863
Eric Avatar asked Dec 14 '22 18:12

Eric


1 Answers

Although this is closed, I would like to post my workaround, as this costed me about two days to figure out. My build failed after an update to Cordova, too.

To get it fixed, I defined not only the password in build.json, but also the storePassword field. As my store had no password before, I recreated the store with a password set. As both fields are present in the build.json, the insert password dialog, that causes the exception doesn't show up and the build runs through.

This is my build.json:

{
  "android": {
      "release": {
          "keystore": "key.storenew",
          "storePassword": "my_password",
          "alias": "my_alias",
          "password": "my_password",
          "keystoreType":"jks"
      }
  }
}

To set a keystore password use the second command from this answer: How to export .key and .crt from keystore

like image 61
Chris Avatar answered Dec 27 '22 13:12

Chris