fix Android compatibility with AGP > 9 hosts in desktop_drop - #498
Open
loucass wants to merge 1 commit into
Open
fix Android compatibility with AGP > 9 hosts in desktop_drop#498loucass wants to merge 1 commit into
loucass wants to merge 1 commit into
Conversation
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.
Follow-up to #495 — @ekuleshov reported that
0.8.2(Gradle 9.1.0 + Flutter 3.44.8) still fails with the sameCould not find method kotlin()error that #495 was meant to fix.Problem
0.8.2made theapply plugin: 'kotlin-android'line conditional on AGP major< 9, but left the Kotlin configuration block unconditional:android { kotlinOptions { jvmTarget } }— the pre-AGP-9 form, removed in AGP 9Result: AGP 8 hosts now passed, but AGP 9.1 hosts failed on the
kotlin {}DSL itself (kotlin()not found when KGP wasn't applied).Root cause
kotlin {}unconditionalkotlin()not found*android.kotlinOptionsbranchkotlin.compilerOptionsbranch*
kotlinextension only exists after KGP is applied.Fix
Make the configuration block itself conditional:
Verification
✓ Built app-debug.apk)desktop_dropexample on AGP 9.1 · Gradle 9.3.1 · Flutter 3.47.1 — run