Reputation: 10626
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...
Upvotes: 4
Views: 2688
Reputation: 119
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
Upvotes: 11
Reputation: 10626
Turns out it is a Cordova bug so I will answer and close this question.
Upvotes: 1