This message was deleted.
# community-support
s
This message was deleted.
c
As noted in the warning, remove that plugin from subprojects.
v
Just do what it told you, roughly, I guess. Apply it additionally to a common parent project or at least add it to the parent projects class loader using
apply false
d
I need that plugin in the child project
v
As noted in the warning, remove that plugin from subprojects.
But that's not what the warning says, is it? It only says to remove the version and that should just be ok in recent Gradle version if there the version is noted too.
I need that plugin in the child project
Try it like the warning really suggests and what I said, which does not imply removing it. 😉
d
so basically I should have my root
build.gradle.kts
file have all the plugins with apply false and that's it?
v
No, not all, the Kotlin Gradle plugin which does not support being applied to sibling projects as it noted. That is not a warning by Gradle.
Well, you can do it with all plugins, but it might be unnecessary clutter.
d
oh! OK
now that we are in the topic (while I wait for the build to run and see if the warning go away) Do you know which version of gradle will fix this?
Copy code
'val Project.libs: LibrariesForLibs' can't be called in this context by implicit receiver. Use the explicit one if necessary
I've been told it's an IDE issue (and I've a suppress on all my
plugins {}
about it https://youtrack.jetbrains.com/issue/KTIJ-19370 https://youtrack.jetbrains.com/issue/KTIJ-19369
v
As you know already that it is an IJ issue (that should be fixed in latest version iirc), why do you expect any Gradle version to change it?
d
ah, sorry.... my brain farted
v
Either ignore the wrong error highlighting in the IDE, add the
@SuppressWarnings
for them, or install the IntelliJ plugin that suppresses the false warning.
d
ok.. so Adding the plugin with
apply false
in the root build file
Copy code
plugins {
    id("com.github.ben-manes.versions") version "0.42.0"
    alias(libs.plugins.android.application) apply false
    alias(libs.plugins.android.library) apply false
    alias(libs.plugins.kotlin.android) apply false
}
got me this error
Copy code
Error resolving plugin [id: 'org.jetbrains.kotlin.kapt', version: '1.7.10']
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
in one of the project that already had it
@Vampire I've added the apply false for all plugins and now it stop complaining... But if I add the Suppress
Copy code
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
like in all the other modules I get an error:
Copy code
* What went wrong:
Script compilation error:

  Line 1: @Suppress("DSL_SCOPE_VIOLATION")
                                          ^ Expecting an expression

1 error
the other build files are ok with me using the Suppress
🤷‍♂️ 1
btw thank you for the help
oh well, I just did this
Copy code
plugins {
    // For some reason putting this suppress above plugins in this file specifically
    // makes gradle really angry
    @Suppress("DSL_SCOPE_VIOLATION")
    run {
thanks for the help
👌 1