Repository navigation
Commit 8ad7de9
Fix AccessibilityBridge startup crash on vendor-modified Android (flutter#184630)
## Summary
- Some vendor-modified Android runtimes report `SDK_INT >= 31` but ship
a `Configuration` class without the `fontWeightAdjustment` field (added
in API 31), causing a `NoSuchFieldError` crash at app startup in
`AccessibilityBridge.setBoldTextFlag`
- Wrap the `fontWeightAdjustment` access in a try/catch for
`NoSuchFieldError`, gracefully defaulting to non-bold text instead of
crashing
## Changes
-
`engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java`:
Added try/catch around `fontWeightAdjustment` field access with fallback
to `shouldBold = false`
Fixes flutter#184286
---------
Co-authored-by: jesswrd <[email protected]>
Co-authored-by: Matt Boetger <[email protected]>
Co-authored-by: Camille Simon <[email protected]>1 parent 21f8100 commit 8ad7de9
1 file changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
706 | 707 | | |
707 | 708 | | |
708 | 709 | | |
709 | | - | |
710 | | - | |
711 | 710 | | |
712 | | - | |
713 | | - | |
| 711 | + | |
714 | 712 | | |
715 | 713 | | |
716 | 714 | | |
| |||
3389 | 3387 | | |
3390 | 3388 | | |
3391 | 3389 | | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
3392 | 3408 | | |
0 commit comments