San*_*Zan 13 java compiler-errors compilation gradle
我收到以下错误:
FAILURE: Build failed with an exception.
* Where:
Initialization script 'C:\Users\User\AppData\Local\Temp\Console_main__.gradle' line: 18
* What went wrong:
A problem occurred configuring root project 'demo'.
> Could not create task ':Console.main()'.
> Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead. You attempted to replace a task named 'Console.main()', but there is no existing task with that name.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 236ms
10:32:59 PM: Task execution finished 'Console.main()'.
Run Code Online (Sandbox Code Playgroud)
Gan*_*nan 15
清除缓存并重新启动应用程序。当您最近升级 gradle 时可能会发生这种情况。如果您使用 intellij 想法,请选择文件 -> 使缓存无效并重新启动。
如果您使用的是 gradle,请删除 .gradle 文件夹并再次运行 gradle。
Jon*_*rum 12
引用2019 年 11 月 15 日Gradle 项目的 GitHub 问题的答案:
这是来自长期弃用的行为,最终在 Gradle 6.0 中出错。不幸的是,我们不会恢复旧的行为,但我们将与 JetBrains 合作,在不需要 IDEA 方面进行特殊处理的情况下使此类事情正常工作。
这已在 IntelliJ IDEA 2019.3(现在处于测试阶段)中得到修复。如果您可以升级到 2019.3 EAP 或 beta,这应该可以在那里工作。
将 IntelliJ 更新到最新的稳定版本以解决此问题。在撰写本文时,2019.3.1 是 IntelliJ IDEA 的最新稳定版本。
| 归档时间: |
|
| 查看次数: |
17838 次 |
| 最近记录: |