Repository navigation
Exception thrown while building "Title" when using mojo shell to run a Material app #378
Copy link
Copy link
Closed
Description
When running a Flutter app in mojo shell, I always get a red screen at the beginning because of the following exception:
Exception caught while building Title("MyTitle")
The null object does not have a getter 'ptr'.
NoSuchMethodError: method not found: 'ptr'
Receiver: null
Arguments: []
Stack trace:
#0 Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1 Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2 ApplicationConnection.requestService (packages/mojo/src/application_connection.dart:89)
#3 _Shell._connectToService (packages/flutter/src/services/shell.dart:59)
#4 _Shell.connectToService (packages/flutter/src/services/shell.dart:74)
#5 _initActivityProxy (packages/flutter/src/services/activity.dart:25)
#6 _activityProxy (packages/flutter/src/services/activity.dart:29)
#7 _activityProxy (packages/flutter/src/services/activity.dart:29)
#8 updateTaskDescription (packages/flutter/src/services/activity.dart:65)
#9 Title.build (packages/flutter/src/material/title.dart:17)
#10 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1050)
#11 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
#12 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1037)
#13 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1032)
#14 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#15 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#16 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
#17 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
#18 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1037)
#19 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1032)
#20 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#21 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#22 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
#23 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
#24 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1037)
#25 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1032)
#26 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#27 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#28 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
#29 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
#30 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1037)
#31 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1032)
#32 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#33 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#34 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
#35 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
#36 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1037)
#37 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1032)
#38 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#39 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#40 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1062)
#41 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:991)
#42 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1037)
#43 StatefulComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1131)
#44 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1032)
#45 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#46 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#47 RenderObjectToWidgetElement.mount (packages/flutter/src/widgets/binding.dart:149)
#48 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (packages/flutter/src/widgets/binding.dart:117)
#49 BuildableElement.lockState (packages/flutter/src/widgets/framework.dart:924)
#50 RenderObjectToWidgetAdapter.attachToRenderTree (packages/flutter/src/widgets/binding.dart:114)
#51 WidgetFlutterBinding._runApp (packages/flutter/src/widgets/binding.dart:76)
#52 runApp (packages/flutter/src/widgets/binding.dart:83)
#53 main (lib/main.dart:25)
but rotating the device to rebuild the app fixes the issue.
This can be reproduced simply by this main code
import 'package:flutter/material.dart';
void main() {
runApp(new MaterialApp(
title: 'MyTitle',
routes: {'/': (RouteArguments args) => new Container()}));
}
Looks like runApp is trying to talk to Android for setting up the toolbar too early, but on the second rebuild after rotating the phone things are setup and it succeeds.
This started happening about a week ago, it was fine before that.
CC @mishadynin
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
abarth commentedon Nov 14, 2015
I believe this is fixed on top-of-tree. At least, when I looked at the issue with @jimbeveridge, we had something that worked in his setup.
aghassemi commentedon Nov 15, 2015
@abarth I am still using Flutter from pub. I will update to the new flow and check out Flutter at head soon and update the issue accordingly.
IvBaranov commentedon Nov 16, 2015
Got the same issue, but with input widget:
abarth commentedon Nov 16, 2015
That looks like a separate issue. Would you be willing to file a new bug about that issue along with the steps to reproduce it? Thanks!
IvBaranov commentedon Nov 16, 2015
@abarth Exception thrown while building widgets #381
aghassemi commentedon Nov 17, 2015
Verified that not an issue @ HEAD of Flutter. Closing.
github-actions commentedon Sep 7, 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.