I've got an android app module's build.gradle file...
# community-support
c
I've got an android app module's build.gradle file that is using a modern plugin block with alias' for everything EXCEPT for
id("org.jetbrains.kotlin.plugin.parcelize")
. I converted it to an entry in my toml, and converted it to
alias(libs.plugins.kotlin.parcelize)
in my build file. but now it wont build UNLESS I go to root build.gradle and add ``alias(libs.plugins.kotlin.parcelize) apply false` ` Why is that needed when using version catalog... but when I just used
id("org.jetbrains.kotlin.plugin.parcelize")
it did not need the extra line in my root build.gradle (bonus points: how did it even work with id if I never declared the version of the plugin I wanted until i now had to add it in version catalog declaration)
e
Did you specify a version for it in the toml file?
Seems like yes from your last line. I believe that Parcelize plugin is bundled with KGP so when you don't specify the version (like your use with
id
) it uses that one. Since you now specify the version, it doesn't use the bundled one, and I believe you have to load it on the classpath by specifying it in the root build file (without applying it).
You should be able to leave the version out in the toml, and it would work like it did before.
c
Did you specify a version for it in the toml file?
yep.
I believe that Parcelize plugin is bundled with KGP so when you don't specify the version (like your use with
id
) it uses that one.
makes sense.
Since you now specify the version, it doesn't use the bundled one, and I believe you have to load it on the classpath by specifying it in the root build file (without applying it).
interesting. let me try to remove the version and see if i can remove the declaration from my root build file. i think overall id like to just keep all my plugins using the same pattern (declare version in toml and declare it in my root build), but i was just more curious on how/why it even worked before. ill report back shortly
indeed the version number is what does the trick. i wonder if there's a "preferred" way. i can see some benefit to just not defining a version for every
org.jetbrains.kotlin.*
plugin and not having to define it in the root.
tried the same for kapt actually and same thing. so the version "trick" holds true
e
the serialization plugin isn't bundled in kgp so it's not the same for all of them
c
is there a list of what gets bundled in kgp? or should i just try to find the source for it?