I\'m trying to get my gradle builds to prompt at the console for a password using examples from stack overflow
When I have a statment such as:
def pa
Simple solution to this is to check the console object for null:
def password = null
def console = System.console()
if (console != null) {
password = console.readLine("Enter keystore password: ")
}
Android Studio no longer complaints about the null object.
To hide typed chars use readPassword() instead of readLine():
password = new String(console.readPassword("\nEnter key password: "))