Repository navigation
Title Widget calling setSystemChromeApplicationSwitcherDescription multiple times causing ANRs #176008
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.needs repro infoAutomated crash report whose cause isn't yet knownAutomated crash report whose cause isn't yet knownr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
Steps to reproduce
- Create a normal project using Material or Widget App
- Introduce state changes on the top of the App without changing the title
- The Title widget build method is executed again, triggering the switcher even when there's no change in the title and color
Expected results
Only trigger setSystemChromeApplicationSwitcherDescription once and only after title of color changes
Actual results
setSystemChromeApplicationSwitcherDescription is called multiple times without being needed. causing ANRs.
StackTrace
main (native):tid=1 systid=28345
#00 pc 0xe42c8 libc.so (__ioctl + 8) (BuildId: 899237b27ce70ad3ff85d806309243c0)
#01 pc 0x9d2dc libc.so (ioctl + 156) (BuildId: 899237b27ce70ad3ff85d806309243c0)
#02 pc 0x71eb0 libbinder.so (android::IPCThreadState::talkWithDriver + 280) (BuildId: 7d0e34af83340709fbee99659190ea9a)
#03 pc 0x733b0 libbinder.so (android::IPCThreadState::waitForResponse + 60) (BuildId: 7d0e34af83340709fbee99659190ea9a)
#04 pc 0x730d4 libbinder.so (android::IPCThreadState::transact + 300) (BuildId: 7d0e34af83340709fbee99659190ea9a)
#05 pc 0x8a5f0 libbinder.so (android::BpBinder::transact + 188) (BuildId: 7d0e34af83340709fbee99659190ea9a)
#06 pc 0x1d0e3c libandroid_runtime.so (android_os_BinderProxy_transact + 152) (BuildId: e205f2989297fb3ba5815631854ad9cc)
at android.os.BinderProxy.transactNative(Native method)
at android.os.BinderProxy.transact(BinderProxy.java:606)
at android.app.IActivityClientController$Stub$Proxy.setTaskDescription(IActivityClientController.java:2108)
at android.app.ActivityClient.setTaskDescription(ActivityClient.java:432)
at android.app.Activity.setTaskDescription(Activity.java:7863)
at io.flutter.plugin.platform.PlatformPlugin.setSystemChromeApplicationSwitcherDescription(PlatformPlugin.java:228)
at io.flutter.plugin.platform.PlatformPlugin.access$200(PlatformPlugin.java:36)
at io.flutter.plugin.platform.PlatformPlugin$1.setApplicationSwitcherDescription(PlatformPlugin.java:97)
at io.flutter.embedding.engine.systemchannels.PlatformChannel$1.onMethodCall(PlatformChannel.java:87)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:267)
at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:292)
at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0(DartMessenger.java:319)
at android.os.Handler.handleCallback(Handler.java:996)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:302)
at android.app.ActivityThread.main(ActivityThread.java:9675)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:601)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1062)
Code sample
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'title',
home: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TextButton(
onPressed: () {
setState(() {});
},
child: const Text('Update State'),
)
],
),
),
),
);
}
}
Screenshots or Video
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.32.8, on macOS 15.6.1 24G90 darwin-arm64, locale en-AE)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 16.2)
! CocoaPods 1.15.2 out of date (1.16.2 is recommended).
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/to/platform-plugins
To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] Connected device (3 available)
! Error: Browsing on the local area network for Kazbek’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
! Doctor found issues in 1 category.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: crashStack traces logged to the consoleStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.needs repro infoAutomated crash report whose cause isn't yet knownAutomated crash report whose cause isn't yet knownr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team



Activity
darshankawar commentedon Sep 26, 2025
@kazbeksultanov Thanks for the report and potential fix. I tried the code with latest stable and master but didn't receive the reported crash log. I clicked on
update statemultiple times. Is there any step that I missed to properly replicate the crash ?kazbek-sultanov-t commentedon Sep 26, 2025
@darshankawar We can't reproduce the ANR and get exact this logs. But root cause is pretty clear.
The invocation of
setSystemChromeApplicationSwitcherDescriptioneach time whensetStateis done.If you put breakpoint on a method
setSystemChromeApplicationSwitcherDescriptionin Title widget, you will see that it will be triggered each time when the buttonUpdate Stateis tapped. But we don't need to trigger it each time, because title and color did not change, this was just rebuilding of the tree.PR is suggesting to make the Title widget stateful and call the
setSystemChromeApplicationSwitcherDescriptiononly when we are really changing the title or color in app switcher description.darshankawar commentedon Sep 26, 2025
Thanks for the update.
Refactor: Convert Title widget to StatefulWidget (#176010)
github-actions commentedon Nov 10, 2025
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 -vand a minimal reproduction of the issue.Refactor: Convert Title widget to StatefulWidget (flutter#176010)