Skip to content

Error starting app on flutter 0.0.15 #245

Closed

Description

@FlutterIssues

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

  1. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by abarth
    Tuesday Nov 03, 2015 at 00:03 GMT


    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.

    Flutter doesn't yet support Mojo 0.3.1.

    Is there something I can do to make the services handle valid?

    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

    ?

  2. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by krisgiesing
    Wednesday Nov 04, 2015 at 23:27 GMT


    With that patch, I get the following error:

    ------------------------------------------------------------------------
    Exception caught while building Title("Address Book")
    The null object does not have a method 'listen'.
    
    NoSuchMethodError: method not found: 'listen'
    Receiver: null
    Arguments: [Closure: (List<int>) => dynamic, onDone: Closure: ({immediate: bool}) => Future from Function 'close':.]
    Stack trace:
    #0      Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
    #1      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
    #2      MojoEventStreamListener.listen (packages/mojo/src/event_stream.dart:194)
    #3      Proxy.sendMessage (packages/mojo/src/proxy.dart:69)
    #4      _ActivityProxyCalls.setTaskDescription (packages/sky_services/activity/activity.mojom.dart:1580)
    #5      updateTaskDescription (packages/flutter/src/services/activity.dart:65)
    

    Stack frames 6 and onward look like stack frames 8 and onward in the original report.

  3. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by abarth
    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.

  4. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by krisgiesing
    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.

  5. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by abarth
    Thursday Nov 05, 2015 at 00:24 GMT


    @zanderso might know

  6. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by zanderso
    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.

  7. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by abarth
    Thursday Nov 05, 2015 at 03:52 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?

    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.

    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 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.

    Proxy's errorFuture will complete with a ProxyError object in this case

    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?

  8. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by zanderso
    Thursday Nov 05, 2015 at 03:57 GMT


    The behavior would be the same for both of those cases.

  9. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by abarth
    Thursday Nov 05, 2015 at 05:51 GMT


    Sounds like we need to roll in mojo and then the patch will resolve the issue.

  10. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by krisgiesing
    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?

    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'image/drawable-xxhdpi/ic_photo_camera_white_24dp.png' does not exist.
    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'navigation/drawable-xxhdpi/ic_check_white_24dp.png' does not exist.
    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'navigation/drawable-xxhdpi/ic_arrow_back_white_24dp.png' does not exist.
    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'content/drawable-xxhdpi/ic_add_black_24dp.png' does not exist.
    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'av/drawable-xxhdpi/ic_volume_up_black_24dp.png' does not exist.
    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'maps/drawable-xxhdpi/ic_place_black_24dp.png' does not exist.
    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'communication/drawable-xxhdpi/ic_email_black_24dp.png' does not exist.
    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'communication/drawable-xxhdpi/ic_phone_black_24dp.png' does not exist.
    [1105/094954:WARNING:asset_bundle_impl.cc(45)] Requested asset 'social/drawable-xxhdpi/ic_person_black_24dp.png' does not exist.
    Received signal 11 <unknown> 000000000000
    #0 0x7f7d0637d72e
    base::debug::StackTrace::StackTrace()
    #1 0x7f7d0637d26f
    base::debug::(anonymous namespace)::StackDumpSignalHandler()
    #2 0x7f7d1c6da340
    <unknown>
    #3 0x7f7d184a85b8
    mojo::common::DataPipeDrainer::~DataPipeDrainer()
    #4 0x7f7d18526414
    blink::(anonymous namespace)::DrainJob::Start()
    #5 0x7f7d1852675c
    _ZN4base8internal7InvokerINS_13IndexSequenceIJLm0ELm1EEEENS0_9BindStateINS0_15RunnableAdapterIMN5blink12_GLOBAL__N_18DrainJobEFvN4mojo16ScopedHandleBaseINS9_22DataPipeConsumerHandleEEEEEEFvPS8_SC_ENS0_8TypeListIJNS0_17UnretainedWrapperIS8_EENS0_13PassedWrapperISC_EEEEEEENSI_IJNS0_12UnwrapTraitsISK_EENSP_ISM_EEEEENS0_12InvokeHelperILb0EvSF_NSI_IJSG_SC_EEEEEFvvEE3RunEPNS0_13BindStateBaseE
    #6 0x7f7d183e7460
    base::debug::TaskAnnotator::RunTask()
    #7 0x7f7d183d309b
    base::MessageLoop::RunTask()
    #8 0x7f7d183d3389
    base::MessageLoop::DeferOrRunPendingTask()
    #9 0x7f7d183d355d
    base::MessageLoop::DoWork()
    #10 0x7f7d18403b16
    mojo::common::MessagePumpMojo::DoRunLoop()
    #11 0x7f7d18403a7d
    mojo::common::MessagePumpMojo::Run()
    #12 0x7f7d183d59b0
    base::RunLoop::Run()
    #13 0x7f7d183d2b0a
    base::MessageLoop::Run()
    #14 0x7f7d183e0a94
    base::Thread::ThreadMain()
    #15 0x7f7d183dfee7
    base::(anonymous namespace)::ThreadFunc()
    #16 0x7f7d1c6d2182
    start_thread
    #17 0x7f7d1c3ff47d
    clone
      r8: 0000000000000000  r9: 000000000010c36a r10: 00000007daac7604 r11: 0000000020024cb4
     r12: 000024ada0a96810 r13: 0000000000000000 r14: 00007f7d16bfe628 r15: 000024ada124aed0
      di: 363636363636364e  si: 0000000000000002  bp: 00007f7d16bfe838  bx: 3636363636363636
      dx: 000024ad9e8b44c0  ax: 000000000000fb6f  cx: 0000000000000001  sp: 00007f7d16bfe5e0
      ip: 00007f7d184a85b8 efl: 0000000000010206 cgf: 0000000000000033 erf: 0000000000000000
     trp: 000000000000000d msk: 0000000004000000 cr2: 0000000000000000
    
  11. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by abarth
    Thursday Nov 05, 2015 at 22:08 GMT


    Is there some local hack I can do to get around this while the real fix is being developed?

    You can just comment out the call to the service. It's just trying to set the title in the Android recents menu.

  12. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by krisgiesing
    Thursday Nov 05, 2015 at 22:28 GMT


    I think that's what I did above, no?

  13. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by abarth
    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?

  14. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by krisgiesing
    Thursday Nov 05, 2015 at 23:31 GMT


    The crash turned out to be a separate issue, fixed by #1972.

  15. FlutterIssues commented on Nov 9, 2015

    @FlutterIssues
    Author

    Comment by abarth
    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.

  16. abarth commented on Dec 5, 2015

    @abarth
    Contributor

    I believe this is all fixed now.

  17. added
    p: toolingAffects the flutter_plugin_tools package
    and removed on Feb 2, 2017
  18. github-actions commented on Sep 5, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  19. locked as resolved and limited conversation to collaborators on Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: regressionIt was better in the past than it is nowdependency: fuchsiaFuchsia team may need to help usp: toolingAffects the flutter_plugin_tools package

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions