Repository navigation
Managing State Tutorial Crashes Galaxy s6 #362
Copy link
Copy link
Closed
Labels
c: crashStack traces logged to the consoleStack traces logged to the console
Description
I tried running the Managing State Tutorial on my Galaxy S6 Edge and I can use the app for a few seconds and then it will either show a black screen or a red screen. It will crash whether I use the button to increment the counter or not, but it will increment.
Here is the code I am running:
import 'package:flutter/material.dart';
void main() {
runApp(
new MaterialApp(
title: 'Flutter Leads',
routes: {
'/': (RouteArguments args) => new Counter()
}
)
);
}
class Counter extends StatefulComponent {
_CounterState createState() => new _CounterState();
}
class _CounterState extends State<Counter> {
int _count = 0;
void _increment() {
setState(() { ++_count; });
}
Widget build(BuildContext context) {
return new Row([
new RaisedButton(
onPressed: _increment,
child: new Text('Increment')
),
new Text('Count: $_count')
]);
}
}
This is the error I got:
android: I/sky : Exception caught while building Navigator-[GlobalObjectKey _MaterialAppState(43269391)]
android: I/sky : Bad state: No element
android: I/sky : Stack trace:
android: I/sky : #0 List.first (dart:core-patch/growable_array.dart:206)
android: I/sky : #1 NavigatorState.build (packages/flutter/src/widgets/navigator.dart:119)
android: I/sky : #2 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1050)
android: I/sky : #3 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
android: I/sky : #4 StatefulComponentElement.update (packages/flutter/src/widgets/framework.dart:1149)
android: I/sky : #5 Element.updateChild (packages/flutter/src/widgets/framework.dart:637)
android: I/sky : #6 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
android: I/sky : #7 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
android: I/sky : #8 StatelessComponentElement.update (packages/flutter/src/widgets/framework.dart:1095)
android: I/sky : #9 Element.updateChild (packages/flutter/src/widgets/framework.dart:637)
android: I/sky : #10 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
android: I/sky : #11 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
android: I/sky : #12 ProxyElement.update (packages/flutter/src/widgets/framework.dart:1186)
android: I/sky : #13 Element.updateChild (packages/flutter/src/widgets/framework.dart:637)
android: I/sky : #14 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
android: I/sky : #15 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
android: I/sky : #16 ProxyElement.update (packages/flutter/src/widgets/framework.dart:1186)
android: I/sky : #17 Element.updateChild (packages/flutter/src/widgets/framework.dart:637)
android: I/sky : #18 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
android: I/sky : #19 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
android: I/sky : #20 ProxyElement.update (packages/flutter/src/widgets/framework.dart:1186)
android: I/sky : #21 Element.updateChild (packages/flutter/src/widgets/framework.dart:637)
android: I/sky : #22 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
android: I/sky : #23 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
android: I/sky : #24 ProxyElement.update (packages/flutter/src/widgets/framework.dart:1186)
android: I/sky : #25 Element.updateChild (packages/flutter/src/widgets/framework.dart:637)
android: I/sky : #26 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
android: I/sky : #27 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
android: I/sky : #28 WidgetFlutterBinding.buildDirtyElements.<anonymous closure> (packages/flutter/src/widgets/binding.dart:55)
android: I/sky : #29 BuildableElement.lockState (packages/flutter/src/widgets/framework.dart:924)
android: I/sky : #30 WidgetFlutterBinding.buildDirtyElements (packages/flutter/src/widgets/binding.dart:50)
android: I/sky : #31 WidgetFlutterBinding.beginFrame (packages/flutter/src/widgets/binding.dart:26)
android: I/sky : #32 FlutterBinding._handlePersistentFrameCallback (packages/flutter/src/rendering/binding.dart:176)
android: I/sky : #33 Scheduler.invokeCallback (packages/flutter/src/animation/scheduler.dart:81)
android: I/sky : #34 Scheduler.beginFrame (packages/flutter/src/animation/scheduler.dart:67)
android: I/sky : #35 _beginFrame (file:///src/flutter/engine/src/out/android_Release/gen/sky/bindings/Customhooks.dart:30)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
c: crashStack traces logged to the consoleStack traces logged to the console
Activity
abarth commentedon Nov 13, 2015
Thanks for the report. That's very strange. We'll need to try replicating the issue on our end.
MicroSpecWes commentedon Nov 13, 2015
I removed the RaisedButton and changed Text to just plain text, it seems to sit there and doesn't crash, but if you tap the screen it will do some sort of fade down animation, and then the screen is black. I am having a hard time recreating the red screen.
sethladd commentedon Sep 20, 2016
A ton of code has changed here. Going to close with the hopes that it's working for you. If not, we'll reopen and take a look.
Thanks for the report! Please give it a shot again and let us know.
github-actions commentedon Aug 17, 2021
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.