Windows上的Gradlew-System.console()为null [英] Gradlew on Windows - System.console() is null

查看:62
本文介绍了Windows上的Gradlew-System.console()为null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

但是我执行

gradlew assembleRelease --no-daemon

我总是得到

Cannot invoke method readPassword() on null object

如何在Windows上请求gradlew的用户输入?

How can i request user input for gradlew on windows?

我在google上搜索了很多内容,但堆栈溢出,但没有任何效果.

推荐答案

在Gradle中使用System.console()存在一些已知问题.如果--no-daemon没有帮助(在我的Mac上它在某种程度上有所帮助),则您可能无能为力,无法工作(向解决该问题的Gradle项目提交拉取请求除外).解决控制台输入问题的一种方法是改为弹出一个Swing对话框.

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.

这篇关于Windows上的Gradlew-System.console()为null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆