I moved all plugin implementations(`classpaths`) f...
# gradle
n
I moved all plugin implementations(
classpaths
) from root
build.gradle.kts
into
buildSrc/build.gradle.kts
but I am now getting weird warnings for some declarations as seen in the attachment. How can I get rid of this?
j
can you share your code?
n
in
buildSrc/build.gradle.kts
I have below block
Copy code
plugins {
    `java-gradle-plugin`
    `kotlin-dsl`
}

kotlinDslPluginOptions {
    experimentalWarning.set(false)
}

repositories {
    mavenCentral()
    google()
}

private object PluginVersions {
    const val kotlin = "1.4.31"
    const val buildTools = "4.1.3"
}

dependencies {

    implementation(kotlin("gradle-plugin", version = PluginVersions.kotlin))
    implementation(kotlin("stdlib-jdk7", version = PluginVersions.kotlin))

    implementation("com.android.tools.build:gradle:${PluginVersions.buildTools}")
}
and I have almost nothing in root
build.gradle.kts
sorry it is a private repo I cannot expose all details but that would be enough I hope.
j
except
java-gradle-plugin
, and stdlib dep, I have the same and it works for me
experimentalWarning is not needed anymore I think
try clean the project or invalidate caches
n
I see. Let me try these first, thanks
j
If you run graflew build, it works?
n
yes build works fine but that warning is annoying, makes me feel like there is something wrong 😕
j
If it works then it is a cache issue or maybe changing the jdk fix the problem
n
now invalidated cache and restarted, waiting on building to be finished. Yeah sometimes I see,
JDK
conflicting warning on IDE, how can I fix
JDK
issues? I installed
Choose Runtime
plugin but seems it didn’t work, either. I chose the Embedded JDK
j
In project structure you can change the jdk too
I haven't used that plugin tho
n
thanks, that was the gradle cache issue now it is fixed 🙂
😄 1
🙂 1