Skip to content

[Android][Accessibility] Startup crash in AccessibilityBridge when reading Configuration.fontWeightAdjustment #184286

Closed

Description

@lukemmtt

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.

Activity

  1. changed the title [-]Android startup crash in AccessibilityBridge when reading Configuration.fontWeightAdjustment[/-] [+][Android][Accessibility] Startup crash in AccessibilityBridge when reading Configuration.fontWeightAdjustment[/+] on Mar 28, 2026
  2. added
    c: crashStack traces logged to the console
    platform-androidAndroid applications specifically
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    fyi-androidFor the attention of Android platform team
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    on Mar 30, 2026
  3. mbcorona commented on Mar 30, 2026

    @mbcorona
    Member

    Hi @lukemmtt, thanks for this report and for sharing the crash logs, and also for taking the team to open a PR.
    Routing to team accessibility for evaluation.

  4. lukemmtt commented on Mar 30, 2026

    @lukemmtt
    ContributorAuthor

    Sure thing, thanks for the routing!

  5. chunhtai commented on Apr 1, 2026

    @chunhtai
    Contributor

    Response from AI assistant:
    I have triaged this issue.

    1. Reproducible example: The issue is a production crash on specific Android 11 devices (OnePlus 8 Pro) and is hard to reproduce without the hardware. The stack trace indicates the issue is related to reading fontWeightAdjustment on a platform where it is missing or problematic.
    2. Fix location: The fix belongs in the Android embedding in the engine (AccessibilityBridge.java).
    3. Duplicates: No duplicate issues were found. However, a PR ([Android][Accessibility] Guard fontWeightAdjustment access in AccessibilityBridge #184287) has been opened by the reporter to address this crash.
    4. Proposed fix: The fix in PR [Android][Accessibility] Guard fontWeightAdjustment access in AccessibilityBridge #184287 appears appropriate. It moves the fontWeightAdjustment access to a helper method and catches NoSuchFieldError to fall back gracefully.
  6. added
    team-androidOwned by Android platform team
    and removed
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    fyi-androidFor the attention of Android platform team
    on Apr 1, 2026
  7. added a commit that references this issue on Apr 5, 2026
    fa5d4e2
  8. added
    P2Important issues not at the top of the work list
    triaged-androidTriaged by Android platform team
    on Apr 14, 2026
  9. added a commit that references this issue on May 27, 2026
    8ad7de9
  10. added a commit that references this issue on Jun 26, 2026
    34cc346
  11. github-actions commented on Jul 14, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  12. locked as resolved and limited conversation to collaborators on Jul 14, 2026
  13. added a commit that references this issue on Jul 21, 2026
    15c5a92
  14. added a commit that references this issue on Jul 23, 2026
    0cd6107
  15. added a commit that references this issue on Aug 11, 2026
    8292702
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: crashStack traces logged to the consoleplatform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions