fix Android compatibility with AGP > 9 hosts in desktop_drop - #498
Conversation
b97b809 to
5bd287b
Compare
boyan01
left a comment
There was a problem hiding this comment.
Thanks for the fix and the detailed verification. Looks good to me.
|
hmm. I'm still getting these errors with 0.8.3 release |
|
@ekuleshov ok thanks. Could you try my branch dependency_overrides:
desktop_drop:
git:
url: https://github.com/loucass/flutter-plugins.git
path: packages/desktop_drop
ref: fix/agp-kotlin-tasks |
|
@loucass with that override the plugin is being reported as non-compliant: and then build fail with this: |
|
@ekuleshov ok since all the if/else approach didn't work either |
|
@loucass it builds with the same warning take a look at this one: |
Ignore this warning. Flutter uses regular expression scanning, and it will issue a warning whenever relate to flutter/flutter#189770 |
|
so happy to hear that it finally have built !! The unconditional KGP apply approach is the final solution same pattern as |
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