I want to use System.console()
in my build.gradle
to let the user enters the password for the keystore.
But then i execute
gradlew assembleRelease --no-daemon
i always get
Cannot invoke method readPassword() on null object
How can i request user input for gradlew on windows?
I searched a lot on google and stack overflow but nothing works.
There are some known issues with using
System.console()
in Gradle. If--no-daemon
doesn't help (it helps to some extent on my Mac), there is likely nothing you can do to make it work (except to submit a pull request to the Gradle project that fixes the problem). One way to work around the console input issues is to pop up a Swing dialog instead.Then don't use
gradlew
. Usegradle
instead. Gradlew runs in the back ground, which is not interactable and therefore how would you enter input that wants to be read?