Installing error

Hello, I’ve got this error trying to install

class org.codehaus.groovy.ast.expr.TupleExpression cannot be cast to class org.codehaus.groovy.ast.expr.ArgumentListExpression (org.codehaus.groovy.ast.expr.TupleExpression and org.codehaus.groovy.ast.expr.ArgumentListExpression are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @36aa7bc2)
class org.codehaus.groovy.ast.expr.TupleExpression cannot be cast to class org.codehaus.groovy.ast.expr.ArgumentListExpression (org.codehaus.groovy.ast.expr.TupleExpression and org.codehaus.groovy.ast.expr.ArgumentListExpression are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @36aa7bc2)

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I tried to choose ‘Re-download dependencies and sync project’, same
build.gradle: pluginManagement { repositories { maven { url "https://plugins.gra - Pastebin.com
Can you help me?

What do you get if you execute with --stacktrace?
And what do you mean with “trying to install”?
Also, what do you get with --version?

And what do you mean with “trying to install”?

I’m trying to follow this Librarian/FORGEGRADLE.md at dev · ParchmentMC/Librarian · GitHub

What do you get if you execute with --stacktrace ?
Also, what do you get with --version ?

Do you mean I should put it in the terminal? It seems like it doesn’t know such commands PS C:\Users\istavi\Desktop\forge-1.18.2-40.2.0-mdk> --stacktraceстрока:1 знак: - Pastebin.com

And what do you mean with “trying to install”

I’m trying to follow this Librarian/FORGEGRADLE.md at dev · ParchmentMC/Librarian · GitHub

That doesn’t really answer the question, because that document does not mention “install” anywhere.

What do you get if you execute with --stacktrace ?
Also, what do you get with --version ?

Do you mean I should put it in the terminal? It seems like it doesn’t know such commands PS C:\Users\istavi\Desktop\forge-1.18.2-40.2.0-mdk> --stacktraceстрока:1 знак: - Pastebin.com

with, so as an additional parameter to your Gradle execution.

I’m sorry I’m a newbie PS C:\Users\istavi\Desktop\forge-1.18.2-40.2.0-mdk> ./gradlew --version - Pastebin.com
I tried to kill the Java process and then delete the whole /Users/<username>/.gradle/caches folder

How does your build script look like?

build.gradle: Untitled (gcc1uj15) - PasteCode.io

Gradle process the plugins { ... } block specially to make sure you do only use the restricted syntax it allows.
Unfortunately, this treatment has a bug and it chokes if it sees the apply plugin: '...' lines and aborts with that error.
That bug is still in 8.1.1, so you should report it.

To fix your build, move these lines outside the plugins { ... } block or even better don’t use that legacy way to apply plugins, but define the plugin repositories properly in your settings script and apply plugin by ID and version in your plugins { ... } block, or even better using a version catalog.

define the plugin repositories properly in your settings script and apply plugin by ID and version in your plugins { ... } block, or even better using a version catalog.

sorry, have no idea how to do this

move these lines outside the plugins { ... } block

now I have another error:

Build file 'C:\Users\istavi\Desktop\forge-1.18.2-40.2.0-mdk\build.gradle' line: 1

Could not compile build file 'C:\Users\istavi\Desktop\forge-1.18.2-40.2.0-mdk\build.gradle'.
> startup failed:
  build file 'C:\Users\istavi\Desktop\forge-1.18.2-40.2.0-mdk\build.gradle': 1: Only Settings scripts can contain a pluginManagement {} block.

build.gradle: Untitled (a94hdr70) - PasteCode.io

thanks for your patience

Well, the error is quite meaningful, isn’t it?
It says “Only Settings scripts can contain a pluginManagement {} block.”, I’m unsure what to add to that.

Btw., you don’t need report the issue with the apply in the plugins { ... } block.
It is already reported at Gradle fails with cryptic error when `plugins {}` contains unexpected code · Issue #7897 · gradle/gradle · GitHub and now also has a pull request to fix it at Fix ClassCastException in Groovy DSL plugins { ... } block syntax checker (#7897) by Vampire · Pull Request #24937 · gradle/gradle · GitHub. It will be fixed and fail with a proper meaningful erro rmessage in 8.3-rc1.