首页 > 解决方案 > 无法创建任务“:调试”。不支持不必要地替换不存在的任务

问题描述

我正在用 Java 8 创建一个 JavaFX 应用程序。

JavaFXports需要 Java 8 。

我已经安装了所有需要的东西,但是在 gradle 运行时,我收到了这个错误:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'MealPlanner'.
> Could not create task ':debug'.
   > Unnecessarily replacing a task that does not exist is not supported.  Use create() or register() directly instead.  You attempted to replace a task named 'debug', 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s

我的 Gradle.build 如下:

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'org.javafxports:jfxmobile-plugin:1.3.17'
    }
}

apply plugin: 'org.javafxports.jfxmobile'

mainClassName = "src.main.java.MainScreen"

repositories {
    jcenter()
}

jfxmobile {
    ios {
        forceLinkClasses = ['ensemble.**.*']
    }
}

已经提出并回答了类似的问题。

这通常是 IntelliJ 的问题,通过更新它或通过删除 .gradle 文件并重建来解决。

但是,我使用的是 Atom 文本编辑器,并尝试删除 .gradle,但没有成功。

而且,正如您所看到的,我没有覆盖任何与“调试”功能有关的内容。

标签: javagradlejavafx

解决方案


推荐阅读