androidkotlinbuild.gradletoml

Plugins dependencies without version (Migration version catalogs)


I started migrating my project to use the new version catalogs, and plugins without version give an error saying that version is needed.

How do I add the plugin below to the toml file since there is no version?

Documentation kotlin parcelize

id("kotlin-parcelize")

Solution

  • Found the answer after reading the documentation for the second time.

    Documentation new version catalogs

    The following code shows how to define the com.android.application plugin in the top and module level build.gradle.kts files. Use alias for plugins that come from the version catalog file and id for plugins that don't come from the version catalog file, such as convention plugins.

    Conclusion

    If there is no version, use id.

    id("kotlin-parcelize")