Repository navigation
Commit 15c5a92
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: Meylis <[email protected]>
Co-authored-by: jesswrd <[email protected]>
Co-authored-by: Matt Boetger <[email protected]>
Co-authored-by: Camille Simon <[email protected]>
(cherry picked from commit 8ad7de9)1 parent 84fc5cb commit 15c5a92
1 file changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
658 | 659 | | |
659 | 660 | | |
660 | 661 | | |
661 | | - | |
662 | | - | |
663 | 662 | | |
664 | | - | |
665 | | - | |
| 663 | + | |
666 | 664 | | |
667 | 665 | | |
668 | 666 | | |
| |||
3256 | 3254 | | |
3257 | 3255 | | |
3258 | 3256 | | |
| 3257 | + | |
| 3258 | + | |
| 3259 | + | |
| 3260 | + | |
| 3261 | + | |
| 3262 | + | |
| 3263 | + | |
| 3264 | + | |
| 3265 | + | |
| 3266 | + | |
| 3267 | + | |
| 3268 | + | |
| 3269 | + | |
| 3270 | + | |
| 3271 | + | |
| 3272 | + | |
| 3273 | + | |
| 3274 | + | |
3259 | 3275 | | |
0 commit comments