Hello all :wave:. I've recently ran into an issue ...
# gradle
s
Hello all 👋. I've recently ran into an issue where contents of the
buildSrc
folder can no longer access the Gradle api. For example:
Copy code
//directory: buildsrc/src/main/kotlin/Util.kt

import org.gradle.api.*

fun Project.foo() = doBar()
Project
comes up as unresolved. I recently updated to Kotlin 1.4.10 and Gradle 6.6.1, and this is a multi-module project. The `buildSrc`'s
build.gradle.kts
file is as it's always been, no changes:
Copy code
plugins {
    `kotlin-dsl`
}

repositories {
    jcenter()
}
Any idea what might have caused this, and how I might resolve it? When I try to access
project.foo()
from a separate module's
build.gradle.kts
file, it hits me with a:
Copy code
Overload resolution ambiguity. All these functions match.
error, and then when I try to go to the declaration it wants me to choose between the actual file that it's declared in (
buildSrc/src/main/kotlin/Util.kt
), and the decompiled java class file. I suspect some change was made in Gradle 6.6.1 with buildSrc dependencies or something but cannot for the life of me figure out what that might be that could be causing this. I've tried explicitly adding the
gradleApi()
dependency as well, but no dice. Any help would be appreciated!
n
Can you share a build scan with the issue?