FAILURE: Build failed with an exception.
* Where:
Build file '/Users/NOTiFY/IdeaProjects/ViViFYd/build.gradle' line: 472
* What went wrong:
Could not determine the dependencies of task ':test'.
> Could not create task ':ViViFYdEAR'.
> Cannot mutate the dependencies of configuration ':earlib' after the configuration was resolved. After a configuration has been observed, it should not be modified.
* 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 generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.
Shows error on '–scan ’ with Develocity:
Could not create task ':ViViFYdEAR'.
> Cannot mutate the dependencies of configuration ':earlib' after the configuration was resolved. After a configuration has been observed, it should not be modified.
You have all the configuration that does not belong there inside the configuration action for the ViViFYdEAR task.
That means it is only executed if the ViViFYdEAR task is configured.
This - as long as task-configuration avoidance is not broken - happens as late as possible and too late to add further dependencies to the earlib configuration which was already used in dependency resolution before the task is configured (which is another sign of something maybe doing bad things as configurations should also not be resolved at configuration time).
Also, before doing a major version upgrade in Gradle you should fix all deprecation warnings, because most become errors after the upgrade. While running on 8.14.3 you should already get a deprecation warning about this behavior.
Move everything that is not configuring the ViViFYdEAR task out of the configuration action for it, like the dependencies block.
Also you should not use apply ... that is legacy and discouraged.
You should always use the plugins { ... } block to apply plugins unless you have very good reasons not to which are extremely rare.
Also, an explicit dependsOn that does not have a lifecycle task on the left-hand side is almost always a code-smell and a sign of something not being done properly, most often task outputs are not properly wired to task inputs which would bring necessary task dependencies automatically.
Btw. just if you are not aware, your logging output appears as soon as your task is configured, whether it will be executed or not or when.
I also highly recommend switching to Kotlin DSL.
By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support when using a good IDE like IntelliJ IDEA or Android Studio.
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.NoClassDefFoundError: org/jetbrains/kotlin/gradle/plugin/AbstractKotlinPluginWrapper
> org/jetbrains/kotlin/gradle/plugin/AbstractKotlinPluginWrapper
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.
BUILD FAILED in 4s
Using : id(‘org.jetbrains.kotlin.jvm’) version ‘2.2.20’
FIXED:
Deleted: .gradle & rebuilt:
Started just now, finished just now, 14s total build time Gradle 9.1.0, Develocity plugin 4.1 Explore console log 0 failures This build did not contain any failures. 0 build deprecations This build did not contain any deprecations.