-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: crashStack traces logged to the consoleStack traces logged to the consolee: device-specificOnly manifests on certain devicesOnly manifests on certain devicesf: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamOwned by Android platform team
Description
Steps to reproduce
- Run the sample code
- Switch to /route2
- Pull out top curtain
Expected results
Curtain shows up and hides back after a delay. App continues to work properly.
Actual results
FATAL EXCEPTION: main.
Bug happens ONLY if:
- Run app in release mode
- Navigator has transitionsBuilder with any default transition widget (FadeTransition in the sample)
- Actual page inside that Navigator has a Slider widget. It's the only widget I found that causes crash.
Code sample
import 'package:flutter/material.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
runApp(const MyApp());
}
final GlobalKey<NavigatorState> mainNavigatorKey = GlobalKey<NavigatorState>();
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) => MaterialApp(
navigatorKey: mainNavigatorKey,
home: const Home(),
);
}
class Home extends StatefulWidget {
const Home({super.key});
@override
State<StatefulWidget> createState() => HomeState();
}
class HomeState extends State<Home> with WidgetsBindingObserver {
final GlobalKey<NavigatorState> nestedNavigatorKey = GlobalKey<NavigatorState>();
final Map<String, Widget> nestedRoutes = {
"/route1": Route1(),
"/route2": Route2(),
};
@override
Widget build(BuildContext context) => Scaffold(
backgroundColor: Colors.white,
body: Column(
children: [
Expanded(
child: Navigator(
key: nestedNavigatorKey,
initialRoute: nestedRoutes.keys.first,
onGenerateRoute: (settings) => PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) => nestedRoutes[settings.name] ?? nestedRoutes[nestedRoutes.keys.first]!,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
return FadeTransition(
opacity: animation,
child: child,
);
// return child;
},
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 50,
children: [
for (String routeName in nestedRoutes.keys) SizedBox(
width: 150,
height: 100,
child: TextButton(
onPressed: () => nestedNavigatorKey.currentState!.popAndPushNamed(routeName),
child: Text(routeName),
),
),
],
),
],
),
);
}
class Route1 extends StatefulWidget {
const Route1({super.key});
@override
State<StatefulWidget> createState() => Route1State();
}
class Route2State extends State<Route2> {
@override
Widget build(BuildContext context) => Slider(
value: 0.75,
onChanged: (value) {},
);
}
class Route2 extends StatefulWidget {
const Route2({super.key});
@override
State<StatefulWidget> createState() => Route2State();
}
class Route1State extends State<Route1> {
@override
Widget build(BuildContext context) => Container(color: Colors.blue, child: Center());
}Screenshots or Video
Logs
Logs
E/AndroidRuntime(16664): FATAL EXCEPTION: main
E/AndroidRuntime(16664): Process: ru.tm10.dozer_dm, PID: 16664
E/AndroidRuntime(16664): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setImportantForAccessibility(int)' on a null object reference
E/AndroidRuntime(16664): at io.flutter.view.AccessibilityBridge.createAccessibilityNodeInfo(AccessibilityBridge.java:1178)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfVirtualNode(AccessibilityInteractionController.java:1318)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfVirtualNode(AccessibilityInteractionController.java:1328)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfVirtualNode(AccessibilityInteractionController.java:1328)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfVirtualNode(AccessibilityInteractionController.java:1328)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfVirtualNode(AccessibilityInteractionController.java:1328)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfVirtualNode(AccessibilityInteractionController.java:1328)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchDescendantsOfRealNode(AccessibilityInteractionController.java:1231)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$AccessibilityNodePrefetcher.prefetchAccessibilityNodeInfos(AccessibilityInteractionController.java:1029)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:341)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController.access$400(AccessibilityInteractionController.java:75)
E/AndroidRuntime(16664): at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1393)
E/AndroidRuntime(16664): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(16664): at android.os.Looper.loop(Looper.java:214)
E/AndroidRuntime(16664): at android.app.ActivityThread.main(ActivityThread.java:7629)
E/AndroidRuntime(16664): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(16664): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:503)
E/AndroidRuntime(16664): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)Flutter Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 3.40.0-1.0.pre-105, on Microsoft Windows [Version 10.0.19045.6456], locale ru-RU)
[√] Windows Version (Њ ©Єа®б®дв Windows 10 Pro 64-а §ап¤ п, 22H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
[√] Connected device (4 available)
[!] Network resources
X A network error occurred while checking "https://cocoapods.org/": Превышен таймаут семафора
! Doctor found issues in 1 category.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: crashStack traces logged to the consoleStack traces logged to the consolee: device-specificOnly manifests on certain devicesOnly manifests on certain devicesf: routesNavigator, Router, and related APIs.Navigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamOwned by Android platform team