Steps to reproduce
This is currently production evidence rather than a local public repro project.
The crash occurs during Android app startup in Flutter's embedding stack:
io.flutter.view.AccessibilityBridge.setBoldTextFlag
io.flutter.view.AccessibilityBridge.<init>
io.flutter.embedding.android.FlutterView.attachToFlutterEngine
io.flutter.embedding.android.FlutterActivity.onCreate
Expected results
Flutter should safely determine whether bold text accessibility is enabled, or gracefully treat the feature as unavailable on runtimes where the field access is unsafe.
Actual results
The app crashes at startup with:
java.lang.NoSuchFieldError - No field fontWeightAdjustment of type I in class Landroid/content/res/Configuration; or its superclasses
Production evidence
From Firebase Crashlytics for a Flutter app pinned to Flutter 3.41.x:
- 95 fatal events in the last 90 days for the same issue
- 100%
OnePlus (OnePlus8Pro)
- 100%
Android (11)
- sampled events from app versions
9.4.2, 9.4.4, 9.4.7, and 9.4.13 all show the same main-thread stack landing in AccessibilityBridge.setBoldTextFlag
Representative stack:
io.flutter.view.AccessibilityBridge.setBoldTextFlag
io.flutter.view.AccessibilityBridge.<init>
io.flutter.embedding.android.FlutterView.attachToFlutterEngine
io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onCreateView
io.flutter.embedding.android.FlutterActivity.createFlutterView
io.flutter.embedding.android.FlutterActivity.onCreate
Why this looks like an embedding bug
The current engine code reads Configuration.fontWeightAdjustment directly inside AccessibilityBridge.setBoldTextFlag().
AndroidX Compose hardened this exact access pattern in July 2024:
That change moved the field access behind a dedicated API-31 helper rather than reading it directly in the main code path.
So this seems less like app code misuse and more like an embedding/runtime compatibility issue where the direct field reference is unsafe on at least some Android 11 / vendor runtimes.
Proposed direction
Mirror the AndroidX pattern in AccessibilityBridge:
- move the
fontWeightAdjustment access behind a @RequiresApi(31) helper
- ideally mark the helper
@DoNotInline
- optionally treat
NoSuchFieldError as "bold text unsupported" instead of crashing
Flutter doctor
Not attached because this is not from a local reproducible app sample yet.
I can provide a minimal patch against flutter/engine if helpful.
Steps to reproduce
This is currently production evidence rather than a local public repro project.
The crash occurs during Android app startup in Flutter's embedding stack:
io.flutter.view.AccessibilityBridge.setBoldTextFlagio.flutter.view.AccessibilityBridge.<init>io.flutter.embedding.android.FlutterView.attachToFlutterEngineio.flutter.embedding.android.FlutterActivity.onCreateExpected results
Flutter should safely determine whether bold text accessibility is enabled, or gracefully treat the feature as unavailable on runtimes where the field access is unsafe.
Actual results
The app crashes at startup with:
Production evidence
From Firebase Crashlytics for a Flutter app pinned to Flutter 3.41.x:
OnePlus (OnePlus8Pro)Android (11)9.4.2,9.4.4,9.4.7, and9.4.13all show the same main-thread stack landing inAccessibilityBridge.setBoldTextFlagRepresentative stack:
Why this looks like an embedding bug
The current engine code reads
Configuration.fontWeightAdjustmentdirectly insideAccessibilityBridge.setBoldTextFlag().AndroidX Compose hardened this exact access pattern in July 2024:
Improve fontWeightAdjustment @RequiresApi guardsThat change moved the field access behind a dedicated API-31 helper rather than reading it directly in the main code path.
So this seems less like app code misuse and more like an embedding/runtime compatibility issue where the direct field reference is unsafe on at least some Android 11 / vendor runtimes.
Proposed direction
Mirror the AndroidX pattern in
AccessibilityBridge:fontWeightAdjustmentaccess behind a@RequiresApi(31)helper@DoNotInlineNoSuchFieldErroras "bold text unsupported" instead of crashingFlutter doctor
Not attached because this is not from a local reproducible app sample yet.
I can provide a minimal patch against
flutter/engineif helpful.