fix(android): skip explicit Kotlin plugin when AGP registers the kotlin extension - #569
Merged
Merged
Conversation
Coverage report
Test suite run success22 tests passing in 2 suites. Report generated by 🧪jest coverage report action from 9580078 |
huextrat
pushed a commit
that referenced
this pull request
Sep 7, 2026
## [2.1.3](v2.1.2...v2.1.3) (2026-09-07) ### Bug Fixes * **android:** skip explicit Kotlin plugin when AGP registers the kotlin extension ([#569](#569)) ([799f2e4](799f2e4))
Owner
Author
|
🎉 This PR is included in version 2.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Android Gradle Plugin 9 ships with built-in Kotlin support and registers the
kotlinextension itself. When this library also applieskotlin-androidunconditionally, Gradle configuration fails before compilation:Consumers should not need to disable AGP's built-in Kotlin support project-wide just to build this dependency, especially because that opt-out is removed in AGP 10.
Change
Apply
kotlin-androidonly when nokotlinextension has already been registered:The guard runs immediately after
com.android.library, so AGP has already had a chance to register its extension.kotlinextensionVerification
./gradlew :react-native-rate-app:compileDebugKotlinwith AGP 9.2.1 and Gradle 9.3.1-Pandroid.newDsl=false -Pandroid.builtInKotlin=falseyarn lintyarn test --maxWorkers=2 --coverage --no-watchman(22 tests, 100% coverage)yarn prepareAdapted from huextrat/react-native-screenshot-aware#613.