Gradle Build failed 无法通知项目评估侦听器

时间:2021-05-11 12:29:29

标签: java gradle

我正在编译,但无法消除错误。

我使用 Gradle 7.0;

buildscript {
    repositories {
        maven { url = 'https://files.minecraftforge.net/maven' }
        maven { url = 'https://repo.spongepowered.org/maven' }
        maven {
            name = 'impactdevelopment-repo'
            url = 'https://impactdevelopment.github.io/maven/'
        }
        jcenter()
        mavenCentral()
        gradlePluginPortal()
    }
    dependencies {
        classpath group: 'com.github.ImpactDevelopment', name: 'ForgeGradle', version: '3.0.115'
        classpath group: 'com.github.ImpactDevelopment', name: 'MixinGradle', version: '0.6.2'
        classpath group: 'gradle.plugin.com.github.jengelman.gradle.plugins', name: 'shadow', version: '7.0.0'
    }
}

我使用以下插件:

plugins {
    id 'de.undercouch.download' version '4.0.0'
    id 'com.github.johnrengelman.shadow' version '7.0.0'
    id 'java'
}

这是失败。

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'addon-example'.
> Failed to notify project evaluation listener.
   > org.gradle.internal.nativeintegration.services.FileSystems.getDefault()Lorg/gradle/internal/nativeplatform/filesystem/FileSystem;
   > Could not create task ':createMcpToSrg'.
      > Could not create task ':extractSrg'.
         > java.lang.NullPointerException (no error message)
   > Could not create task ':createMcpToObf'.
      > Could not create task ':extractSrg'.
         > java.lang.NullPointerException (no error message)

* 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 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 2s

堆栈跟踪:

http://paste.cytooxien.de/buqugivuso.cs

现在有人能解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

我的解决方案是将 gradle 降级到 4.10.3。我觉得我用的插件只支持低于5的gradle版本