Проблема с gradle

Версия Minecraft
1.12.2
API
Forge
4,046
63
645
Всем привет!
Кто-нибудь сталкивался с такой штукой? Как это побороть?
Скачал свою старую репу, попытался импортировать, а тут такое.
 
Краш-лог
Description    Resource    Path    Location    Type
Could not fetch model of type 'EclipseProject' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14-bin.zip'.
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.
What went wrong:
java.lang.ExceptionInInitializerError (no error message)
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 1.12.2 line 0 Gradle Error Marker
Краш-лог:
Description    Resource    Path    Location    Type
Could not fetch model of type 'EclipseProject' using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14-bin.zip'.
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.
What went wrong:
java.lang.ExceptionInInitializerError (no error message)
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.    1.12.2        line 0    Gradle Error Marker
4,046
63
645
Теперь несколько других ошибок )

Код:
Description    Resource    Path    Location    Type
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'.
A problem occurred configuring root project '1.12.2'.
Could not resolve all dependencies for configuration ':classpath'.
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://files.minecraftforge.net/maven)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.2/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.     1.12.2        line 0    Gradle Error Marker

Код:
Description    Resource    Path    Location    Type
Project '1.12.2' is missing required library: 'C:\Users\XXX\.gradle\caches\modules-2\files-2.1\ca.weblite\java-objc-bridge\1.0.0\6ef160c3133a78de015830860197602ca1c855d3\java-objc-bridge-1.0.0.jar'    1.12.2        Build path    Build Path Problem

Код:
Description    Resource    Path    Location    Type
The project cannot be built until build path errors are resolved    1.12.2        Unknown    Java Problem

Может быть, проект нужно было как-то пересобрать? Но, помню, это тоже не помогало.
 
Попробуй в build.gradle заменить секцию buildscript на эту:
Gradle (Groovy):
buildscript {
    repositories {
        maven { url = 'https://maven.minecraftforge.net/' }
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
    }
}

после чего запустить очистку кэша с --refresh-dependencies
 
4,046
63
645
В общем, решил вообще скачать актуальный фордж.
Всё пересобрал.
В итоге та же ошибка, но уже с новым градлом 🤦‍♂️
Код:
Description    Resource    Path    Location    Type
Could not run build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-4.9-bin.zip'.
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.9/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.
* What went wrong:
java.lang.ExceptionInInitializerError (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    1.12.2        line 0    Gradle Error Marker
 
Для 1.12.2 версии нужно использовать минимум gradle 7.1. Смог повторить твою ошибку после даунгрейда градла с 7.2 до 4.9 (на mc 1.12.2, forgeGradle 5.1, jdk 8):
Форматирование (BB-код):
FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.

* What went wrong:
java.lang.ExceptionInInitializerError (no error message)

А вот и сама причина:
Форматирование (BB-код):
A problem occurred evaluating root project 'nefrimactmod'.
> Failed to apply plugin [id 'net.minecraftforge.gradle']
> Found Gradle version Gradle 4.9. Minimum required is Gradle 7.1.
     Note: Upgrade your gradle version first before trying to switch to FG5.
 
Странно, так как в самом фордже забита такая версия.
если ты устанавливаешь сорцы форджа вручную, то они идут со своим градлом, который с версии 1.12.2 (та даже с 1.7.10, чего уж там) в 80% не запустится, так как он слишком старый.
 
А примера build.gradle для этой версии нет?
Gradle (Groovy):
buildscript {
    repositories {
        maven { url = 'https://maven.minecraftforge.net/' }
        mavenCentral()
    }
    dependencies {
        classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
    }
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'idea'

group = 'your.group'
version = '1.0.0'

idea {
    module {
        inheritOutputDirs = true
    }
}

java {
    archivesBaseName = 'mod'
    toolchain.languageVersion = JavaLanguageVersion.of(8)
}

//sourceSets { main { output.resourcesDir = output.getClassesDirs().getSingleFile() }}
minecraft {
    runs {
        client {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'REGISTRIES'

            property 'forge.logging.console.level', 'debug'

            mods {
                mod {
                    source sourceSets.main
                }
            }
        }

        server {
            workingDirectory project.file('run')

            property 'forge.logging.markers', 'REGISTRIES'

            property 'forge.logging.console.level', 'debug'

            mods {
                mod {
                    source sourceSets.main
                }
            }
        }
    }
}

sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
}

dependencies {
    minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860'

    implementation fg.deobf("io.gitlab.hohserg.elegant.networking:elegant-networking-1.12:3.14")
    annotationProcessor "io.gitlab.hohserg.elegant.networking:annotation-processor:3.14"
}

jar {
    manifest {
        attributes([
                "Specification-Title"     : "mod",
                "Specification-Vendor"    : "Lalalala",
                "Specification-Version"   : "1",
                "Implementation-Title"    : project.name,
                "Implementation-Version"  : project.jar.archiveVersion,
                "Implementation-Vendor"   : "LALALALALA",
                "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
        ])
    }
}

jar.finalizedBy('reobfJar')

task prepareAssets(type: Copy) {
    group = 'build'
    from project.file('src/main/resources')
    into project.file('build/classes/main')
}
project.classes.dependsOn(prepareAssets)
 
Ещё вполне возможно, что ты не убрал из build.gradle вот это
и вот это
idea { module { inheritOutputDirs = true } }
из-за чего gradle затянул себе ненужный для эклипса плагин и пытается конфижить твой проект под идею.
 
4,046
63
645
Бля...
Да сколько можно? 🤣
Java:
[2023-06-08 18:51:15] [INFO   ] Natives: D:\Mods\MistyWorld\1.12.2\build\natives
[2023-06-08 18:51:15] [INFO   ] Main Class: net.minecraft.launchwrapper.Launch
[2023-06-08 18:51:15] [INFO   ] Srg2Mcp: D:\Mods\MistyWorld\1.12.2\build\createSrgToMcp\output.srg
[2023-06-08 18:51:15] [INFO   ] Extra: []
[2023-06-08 18:51:15] [INFO   ] Running with arguments: [--version, 1.12, --assetIndex, 1.12, --assetsDir, C:\Users\ХХХ\.gradle\caches\forge_gradle\assets, --accessToken, {REDACTED}, --userProperties, [], --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker]
Exception in thread "main" java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at net.minecraftforge.legacydev.Main.start(Main.java:86)
    at net.minecraftforge.legacydev.MainClient.main(MainClient.java:29)
Caused by: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
    at net.minecraft.launchwrapper.Launch.<init>(Launch.java:34)
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    ... 6 more

Кста, хуклибу данный градл поддерживает? Или это не от него зависит?
 
1,355
109
233
1.12.2 очень чувствительна к релизу JDK. Тебе нужно чтоб у тебя была JDK 8 основной.
Сам с таким сталкивался, 11 не катит. Пришлось ставить 8 и удалять все остальные jdk. Далее настройка java_home на 8 java (чтоб eclipse не жаловался), а для IDEA ручкам выставил 11 и 17 jdk.
 
Кста, хуклибу данный градл поддерживает? Или это не от него зависит?
Хуклибу же обычно подключают не через сборщик, а как локальный модуль, так что влиять не должно.
Хотя, если сильно хочется чтобы всё было красиво, можно поставить Jitpack и подключить как зависимость напрямую с гитхаба.
 
1,355
109
233
Мы же задаём версию в градле, далее сборщик сам должен подхватывать указанную версию и использовать её.
В том и проблема, что оно подхватывает это когда захочет, ибо даже настройка граблей мне не помогла совсем. Только вышеописанные мною действия. Хотя мб это у меня винда шалит.
 
Сверху