Repository navigation
Error starting app on flutter 0.0.15 #245
Description
Issue by afandria
Monday Nov 02, 2015 at 21:22 GMT
Originally opened as https://github.com/flutter/engine/issues/1901
I've made it up to 0.0.14, but I'm getting a shell/embedder problem on 0.0.15.
I'm using the latest Mojo local installation, but the dart package for mojo is 0.3.0 instead of its latest, 0.3.1. I can't seem to get it to go to 0.3.1, even with pub upgrade, but mojo 0.3.0 works with flutter 0.0.14.
I linted my code with dartanalyzer, and there are no problems. (From 0.0.14 to 0.0.15, embedder was changed to shell, in accordance with this flutter-team-archive/engine@92b9815 change)
When I launch my app, I get a red screen and this error:
------------------------------------------------------------------------
Exception caught while building Title("Croupier")
'packages/mojo/src/application_connection.dart': Failed assertion: line 87: '!proxy.impl.isBound &&
(remoteServiceProvider != null) &&
remoteServiceProvider.impl.isBound' is not true.
Stack trace:
#0 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:27)
#1 ApplicationConnection.requestService (packages/mojo/src/application_connection.dart:87)
#2 _Shell._connectToService (packages/flutter/src/services/shell.dart:59)
#3 _Shell.connectToService (packages/flutter/src/services/shell.dart:74)
#4 _initActivityProxy (packages/flutter/src/services/activity.dart:25)
#5 _activityProxy (packages/flutter/src/services/activity.dart:29)
#6 _activityProxy (packages/flutter/src/services/activity.dart:29)
#7 updateTaskDescription (packages/flutter/src/services/activity.dart:65)
#8 Title.build (packages/flutter/src/material/title.dart:17)
#9 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1046)
#10 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:987)
#11 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1033)
#12 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1028)
#13 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#14 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#15 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1058)
#16 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:987)
#17 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1033)
#18 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1028)
#19 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#20 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#21 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1058)
#22 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:987)
#23 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1033)
#24 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1028)
#25 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#26 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#27 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1058)
#28 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:987)
#29 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1033)
#30 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1028)
#31 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#32 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#33 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1058)
#34 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:987)
#35 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1033)
#36 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1028)
#37 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#38 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#39 ComponentElement.performRebuild (packages/flutter/src/widgets/framework.dart:1058)
#40 BuildableElement.rebuild (packages/flutter/src/widgets/framework.dart:987)
#41 ComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1033)
#42 StatefulComponentElement._firstBuild (packages/flutter/src/widgets/framework.dart:1127)
#43 ComponentElement.mount (packages/flutter/src/widgets/framework.dart:1028)
#44 Element._inflateWidget (packages/flutter/src/widgets/framework.dart:765)
#45 Element.updateChild (packages/flutter/src/widgets/framework.dart:644)
#46 RenderObjectToWidgetElement.mount (packages/flutter/src/widgets/binding.dart:148)
#47 RenderObjectToWidgetAdapter.attachToRenderTree.<anonymous closure> (packages/flutter/src/widgets/binding.dart:116)
#48 BuildableElement.lockState (packages/flutter/src/widgets/framework.dart:920)
#49 RenderObjectToWidgetAdapter.attachToRenderTree (packages/flutter/src/widgets/binding.dart:113)
#50 WidgetFlutterBinding._runApp (packages/flutter/src/widgets/binding.dart:76)
#51 runApp (packages/flutter/src/widgets/binding.dart:82)
#52 main (lib/main.dart:36)
------------------------------------------------------------------------
This is likely related to the aforementioned flutter-team-archive/engine@92b9815 change. I added a few print statements, and it looks like remoteServiceProvider is null. This happens when the mojo ApplicationConnection isn't given a remoteServiceProvider.
Looking at services/shell.dart, this happens only if servicesHandle.isValid is not true. (https://github.com/flutter/engine/blob/master/sky/packages/sky/lib/src/services/shell.dart#L32)
Is there something I can do to make the services handle valid? I am running with pub run sky_tools run_mojo`
Activity
FlutterIssues commentedon Nov 9, 2015
Tuesday Nov 03, 2015 at 00:03 GMT
Flutter doesn't yet support Mojo 0.3.1.
I think the right fix is to not try to create an embedder connection when we don't have these handles. Does the following patch help:
https://gist.github.com/abarth/fba6c001c52fe34c96e2
?
FlutterIssues commentedon Nov 9, 2015
Wednesday Nov 04, 2015 at 23:27 GMT
With that patch, I get the following error:
Stack frames 6 and onward look like stack frames 8 and onward in the original report.
FlutterIssues commentedon Nov 9, 2015
Wednesday Nov 04, 2015 at 23:29 GMT
I see. We could create a message pipe, bind it, and then close the pipes but it seems like there should be a more direct way of putting the proxy object into a state where it thinks the underlying mojo handle is closed.
FlutterIssues commentedon Nov 9, 2015
Wednesday Nov 04, 2015 at 23:30 GMT
Yeah. I looked into this a little bit but I don't know enough about how Mojo connections are managed to see the right way to do this.
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 00:24 GMT
@zanderso might know
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 03:45 GMT
I think I'm missing a lot of context, but is the app supposed to be able to work even though internals.takeServicesProvidedByEmbedder() doesn't supply a valid handle? What is supposed to happen in that case if a call is made through a proxy that is still unbound even after attempting to bind it?
After https://github.com/domokit/mojo/commit/2918964546273a3471012acd14e680289088e9b7, for a call not expecting a response, the Proxy's errorFuture will complete with a ProxyError object in this case, and execution will continue from that point. Before that change, error handling for Proxies is a bit broken.
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 03:52 GMT
Yes. If the embedder doesn't provide any services, we should model that as a service provider that doesn't have any services (i.e., closes the handles for all incoming interface requests). The question is whether we can do that with the Dart bindings without actually creating and closing a real message pipe.
After calling this function, the proxy should act the same way it acts if it had been bound to a message pipe whose remote end was subsequently closed.
How does that compare to what would happen if we first bound the proxy to a message pipe and then closed the remote end of the message pipe?
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 03:57 GMT
The behavior would be the same for both of those cases.
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 05:51 GMT
Sounds like we need to roll in mojo and then the patch will resolve the issue.
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 21:17 GMT
If I comment out the call to _activityProxy.ptr.setTaskDescription in updateTaskDescription, I fail later with a segmentation fault. Is that expected? Is there some local hack I can do to get around this while the real fix is being developed?
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 22:08 GMT
You can just comment out the call to the service. It's just trying to set the title in the Android recents menu.
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 22:28 GMT
I think that's what I did above, no?
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 22:45 GMT
Ah, I misread what you wrote. Looks like you're hitting another issue. Do that crash still happen if you add those resources to your flutter.yaml so they're in your FLX bundle?
FlutterIssues commentedon Nov 9, 2015
Thursday Nov 05, 2015 at 23:31 GMT
The crash turned out to be a separate issue, fixed by #1972.
FlutterIssues commentedon Nov 9, 2015
Friday Nov 06, 2015 at 03:45 GMT
The next step here is to roll Mojo into Flutter. I believe @collinjackson is working on that.
abarth commentedon Dec 5, 2015
I believe this is all fixed now.
github-actions commentedon Sep 5, 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.