Commit 43cab95
committed
fix(screen_state): restore compatibility with AGP < 9 and Dart 3.12.0
The 5.0.1 release regenerated the Android build script from the
Flutter 3.44 plugin template, which pins AGP 9.0.1/Kotlin 2.3.20 on
the buildscript classpath and assumes AGP 9 built-in Kotlin. This
broke the Android build for every consuming app on AGP 8.x.
- Apply the Kotlin Gradle plugin conditionally (AGP < 9) per the
Flutter built-in Kotlin migration guide, and drop the pinned
buildscript toolchain so the consuming app supplies it.
- Relax the Dart SDK lower bound from ^3.12.2 to >=3.12.0; the
patch-level pin was a template stamp and blocked Flutter 3.44.0.
- Convert ScreenReceiver.java (living in src/main/kotlin) to Kotlin.
It was only compiled thanks to a sourceSets override; without it
apps crash with NoClassDefFoundError at runtime.
Verified: clean debug builds and dex contents on Flutter 3.38.1
(AGP 8.11) and Flutter 3.44.0 (AGP 9.0.1) host apps.1 parent b874f2a commit 43cab95
6 files changed
Lines changed: 33 additions & 48 deletions
File tree
- packages/screen_state
- android
- src/main/kotlin/dk/cachet/screen_state
- example
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
1 | 8 | | |
2 | 9 | | |
3 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 2 | + | |
16 | 3 | | |
17 | 4 | | |
18 | 5 | | |
| |||
25 | 12 | | |
26 | 13 | | |
27 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
28 | 23 | | |
29 | 24 | | |
30 | 25 | | |
| |||
35 | 30 | | |
36 | 31 | | |
37 | 32 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 33 | | |
48 | 34 | | |
49 | 35 | | |
| |||
65 | 51 | | |
66 | 52 | | |
67 | 53 | | |
68 | | - | |
| 54 | + | |
69 | 55 | | |
70 | 56 | | |
71 | 57 | | |
| |||
Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments