Repository navigation
Conversation
Apply the external Kotlin plugin only when AGP has not provided Kotlin support, and use compilerOptions for the Java 17 target. Assisted-by: OpenCode:anyrouter-copy/gpt-6.1-sol
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.
Description
Fixes #218.
AGP 9 supplies Kotlin support by default. Applying
kotlin-androidagain fails during project configuration withCannot add extension with name 'kotlin', as there is an extension already registered with that name.Apply the external Kotlin Android plugin only when the Android library plugin has not registered the Kotlin extension. This retains the existing AGP 8 path and supports AGP 9 with built-in Kotlin either enabled or disabled. Move the JVM 17 target from
android.kotlinOptionstokotlin.compilerOptions, which both implementations support. The existing KGP 2.1.0 dependency, SDK requirements, Talsec security plugin and SDK configuration are preserved.Validation
Executed on Windows with JDK 17 and the checked-out native sources:
android.builtInKotlin=false,android.newDsl=falseThe AAR builds used an isolated Gradle host with Flutter embedding and the real Flutter lifecycle plugin.
app.talsec.plugin1.1.0 and SDK 20.0.1 remained enabled. The library-only host reports that license-token generation is skipped because it has no:app; the APK builds used a real host application. These are build checks, not device threat-detection/callback validation.Commands:
All 91 existing tests passed;
dart analyze lib testreported no issues. Fullflutter analyze --no-pubreports five existing deprecation infos for the example'spackage:flutter/material.dartimports under this development SDK. AGP 8.8.1 also reports its existing compileSdk 36 support warning.As a negative control, restoring only the unconditional Kotlin plugin application reproduces the duplicate-extension configuration failure on AGP 9.0.1; restoring the fix passes.
Checklist
AI assistance: OpenCode (anyrouter-copy/gpt-6.1-sol) for implementation, validation and PR drafting. The validation commands were executed by the agent.