[ 
https://issues.apache.org/jira/browse/CB-13684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16447431#comment-16447431
 ] 

Rodrigo commented on CB-13684:
------------------------------

I'm facing the same issue when doing "cordova build --release"

Here is my build.json file:

 
{code:java}
{
"android": {
"release": {
"keystore": "my-release-key.keystore",
"storePassword": "",
"alias": "alias_name",
"password": "",
"keystoreType": ""
}
}
}
{code}
some enviroment info:

 
{code:java}
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

Cordova Platforms : android 7.1.0
Ionic Framework : unknown

System:

Android SDK Tools : 26.1.1
Node : v7.0.0
npm : 5.6.0 
OS : Linux 4.13

{code}
and the error it self:

 
{code:java}
Parallel execution with configuration on demand is an incubating feature.
publishNonDefault is deprecated and has no effect anymore. All variants are now 
published.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' 
instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be 
removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at 
build_f2pg7yypviczce27famopi55d.run(/home/unknown/git/APP/platforms/android/app/build.gradle:145)

FAILURE: Build failed with an exception.

* Where:
Script '/home/unknown/git/APP/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)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug 
option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
(node:25541) UnhandledPromiseRejectionWarning: Unhandled promise rejection 
(rejection id: 1): Error: /home/unknown/git/APP/platforms/android/gradlew: 
Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Script '/home/unknown/git/APP/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)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug 
option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
{code}
before I upgraded to android 7.1.0 it used to prompt me to input the passwords 
and carry on.....
I placed the passwords on "storePassword" and "keystoreType" and worked 
fine..... but I don't want them there so please fix this..... Thanks

> Not be able to sign apk with 6.4.0 and 7.0.0 without specifying passwords in 
> build.json
> ---------------------------------------------------------------------------------------
>
>                 Key: CB-13684
>                 URL: https://issues.apache.org/jira/browse/CB-13684
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-android
>            Reporter: Kevin Lot
>            Assignee: Joe Bowser
>            Priority: Major
>
> Since 6.4.0, sign APK without specify passwords in config file does not work.
> Cause gradle 4.1.0 has this issue [#2826] - Use SwingBuilder in customize 
> task on Android studio throw java.awt.HeadlessException. 
> ([link|https://github.com/gradle/gradle/issues/2826]).
> If you don't specify passwords in config file to sign your APK, compilation 
> launches a window with SwingBuilder to prompt passwords.
> {code:java}
> def doPromptForPassword(msg) {
>     if (System.console() == null) {
>         def ret = null
>         new SwingBuilder().edt {
>             dialog(modal: true, title: 'Enter password', alwaysOnTop: true, 
> resizable: false, locationRelativeTo: null, pack: true, show: true) {
>                 vbox {
>                     label(text: msg)
>                     def input = passwordField()
>                     button(defaultButton: true, text: 'OK', actionPerformed: {
>                         ret = input.password;
>                         dispose();
>                     })
>                 }
>             }
>         }
>         if (!ret) {
>             throw new GradleException('User canceled build')
>         }
>         return new String(ret)
>     } else {
>         return System.console().readPassword('\n' + msg);
>     }
> }
> {code}
> On Linux Mint 18.3 and MacOs High sierra, even in terminal, System.console() 
> return null and compilation crashes due to gradle issue.
> Thanks for help.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to