Skip to content

fix(android): only apply kotlin-android plugin if not already applied - #75

Merged
OS-pedrogustavobilro merged 1 commit into
mainfrom
fix/RMET-5379/kotlin-agp9
Aug 10, 2026
Merged

fix(android): only apply kotlin-android plugin if not already applied#75
OS-pedrogustavobilro merged 1 commit into
mainfrom
fix/RMET-5379/kotlin-agp9

Conversation

@OS-pedrogustavobilro

@OS-pedrogustavobilro OS-pedrogustavobilro commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Guards the explicit apply plugin: 'kotlin-android' behind a check for an existing kotlin extension. Under AGP 9, the Android/Kotlin toolchain can already register the kotlin extension before this plugin's build.gradle runs, so the unconditional apply fails with:

Failed to apply plugin 'kotlin-android'. > Cannot add extension with name 'kotlin', as there is an extension already registered with that name.

This PR is essentially a clone of ionic-team/capacitor-file-viewer#32

@OS-pedrogustavobilro
OS-pedrogustavobilro merged commit b2223e5 into main Aug 10, 2026
8 checks passed
@OS-pedrogustavobilro
OS-pedrogustavobilro deleted the fix/RMET-5379/kotlin-agp9 branch August 10, 2026 17:18
capacitor-bot pushed a commit that referenced this pull request Aug 11, 2026
## [2.0.5](v2.0.4...v2.0.5) (2026-08-11)

### Bug Fixes

* **android:** only apply kotlin-android plugin if not already applied ([#75](#75)) ([b2223e5](b2223e5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants