flutter-plugins icon indicating copy to clipboard operation
flutter-plugins copied to clipboard

desktop_multi_window crashes with a Firebase project

Open macwilko opened this issue 2 years ago • 4 comments

When adding firebase to the project, and creating a new window, the project will crash before rendering the new window.

The following error is logged:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.4 22F66 darwin-arm64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] VS Code (version 1.79.1)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

macwilko avatar Jun 22 '23 10:06 macwilko

@mattsrobot this happens because the instance of the Flutter Engine that corresponds to the new window doesn't get access to the plugins from the main instance. You need to write an interoperable layer that the windows can use to communicate with each other by way of the invokeMethod function.

GroovinChip avatar Aug 07 '23 14:08 GroovinChip