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

Joe Bowser edited comment on CB-13684 at 1/18/18 9:37 PM:
----------------------------------------------------------

OK, for some weird reason we can't use ant.input because it cases the Cordova 
build scripts to freeze up.  For now, you have to specify passwords in  due to 
it being a Gradle bug that we can't work around.  There's a lot of people 
gathering the torches and pitchforks since this breaks their builds, but since 
gradle hasn't provided a reliable way of prompting for passwords in a daemon 
(which is why the console object is null) when it's being shelled out.

If someone can get Cordova to work well with ant.input, I'd be really happy to 
pull that PR in, but whenever I switch to using that to build something, I get 
stuck with the CLI hanging.  There's no easy fix/workaround for this bug other 
than specifying your passwords in build.json.


was (Author: bowserj):
OK, for some weird reason we can't use ant.input because it cases the Cordova 
build scripts to freeze up.  For now, you have to specify passwords in  due to 
it being a Gradle bug that we can't work around.  There's a lot of people 
gathering the torches and pitchforks since this breaks their builds, but since 
gradle hasn't provided a reliable way of prompting for passwords in a daemon 
(which is why the console object is null) when it's being shelled out.

If someone can get Cordova to work well with ant.input, I'd be really happy to 
pull that PR in, but whenever I switch to using that to build something, I get 
stuck with the CLI hanging.  There's no easy fix/workaround for this bug other 
than specifying your passwords in build.json.

> Not be able to sign apk with 6.4.0 and 7.0.0
> --------------------------------------------
>
>                 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: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to