I'm having some issues with my setup where I have ...
# gradle
m
I'm having some issues with my setup where I have projects A depends on B depends on C, but because B gets loaded after A, it throws this error:
Copy code
org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'org.jetbrains.kotlin.jvm'.
   ...
org.gradle.api.internal.DefaultMutationGuard$IllegalMutationException: Gradle#projectsEvaluated(Action) on build 'project_root_name' cannot be executed in the current context.
   ...
The dependency is added as
api(project(":B", "namedElements"))
as required by the toolchain. How would I go about fixing it?
t
Could you show the full stacktrace?
m
I figured it out, apparently using tasks.withType<T> { ... } doesn't configure them lazily, instead you have to use withType<T>().configure { ... } I forced configurations to resolve in that block, causing the problem
👍 1
t
yeah,
tasks.withType {}
API is confusing sad panda