ganachoco
10/05/2025, 9:19 AMIsolated Projects feature on my sample android app project.
This app project has convention plugin which has dependencies with AGP, KGP, KSP and etc...
After migrated subprojects to gradle.lifecycle.beforeProject (as recommended), I found all plugins should be loaded which have dependent with convention plugin on settings.gradle.kts
https://github.com/ganadist/minimal-reproducible-example/commit/1ab2053d43b933554b3b273b3d2c43b8cd85e8f9
After the migration, I did verify that the build works, but dependency management of plugins has become very cumbersome. 😞
I want to know if the method I used is correct and if there is a better way.Philip W
10/05/2025, 11:02 AMVampire
10/05/2025, 11:16 AMor add the convention project in settings.gradle with apply falseThat already is what he is doing. The question though is, why you add all the other plugins multiple times and also define additionally a default version. Just remove the default versions (the stuff in the
pluginManagement { plugins { ... } } block and also remove all the plugins in the plugins { ... } block except for your convention plugin.
Your convention plugin already has dependencies on the plugins, so they are already added to the same classpath.
If you then apply those plugins in project build scripts without a version, it will just use the one that is on the classpath without an "unknown version" complaint.
The problem in the current setup is, that your convention plugin has dependencies on the plugins so they come to the classpath with unknown version as only the plugins from the plugins { ... } block have known version, and by defining the default versions in the pluginManagement block you effectively in the project build scripts apply the plugins with that version and thus there is the problem with the "unknown" version.ganachoco
10/05/2025, 11:42 AM