feat: agp v9 adoption#1006
Conversation
Updated AGP v9 adoption proposal with changes for React Native core and community libraries, including Gradle upgrades and migration patterns.
|
The RFC looks great, thanks for putting it together! I've already started working on AGP9 support on the Expo side and opened a few PRs. Most things are working well, but I've hit a few unexpected issues that'll need more work. For instance, we have some custom Apollo client configuration in the dev-launcher that stopped working. I'll share more once I figure out how to fix it. |
|
One random thought: what do you guys think about creating a |
This sounds like a nice idea and could help with one part of the migration, but after thinking about it more, I’m not sure it would add enough value on its own. Even with a kotlin-android-compat plugin, library authors would still need to handle a few manual migration steps:
The custom plugin could dynamically apply kotlin-android for AGP < 9, which is useful. But it cannot really solve the case where the consuming project has already applied kotlin-android, because we can apply plugins programmatically, but we can’t safely “unapply” a plugin that was already applied by the build script. So in practice, the plugin would cover only one part of the migration: conditionally applying kotlin-android for AGP 8 and below. The removal of kotlin-android for AGP 9+, plus the other DSL/source-set migrations, would still require manual changes from library authors. Because of that, I think the value might be relatively limited. |
|
Yes, I agree it won't solve every problem - realistically, this will still require some manual changes from library maintainers. But other changes, such as using |
True that. So If I catch it correctly, the library maintainers will need to replace the For some libraries, this might be the only change that they need, for eg, I am also wondering whether to introduce a separate compat plugin OR we can add this as a fallback mechanism to RNGP? That way the library authors may not need to implement another plugin. Nicola suggested that we can also think of separating library implementations from RNGP in a separate Gradle plugin, however that is optional for now and we will start that separately than AGP 9. I am mentioning it here because if we are able to add this compat mechanism to RNGP, we can later extract it out.
Yes it should work, however there are a few catches. The kotlin-only sources can not be added to |
Proposal: Android Gradle Plugin v9 Adoption
View the rendered RFC