Skip to content

dayoul/flutter_engine_group_error

Repository files navigation

FlutterEngine error on hot restart(Android only)

This repo is the sample code to reproduce error that is described in issue. There are two different FlutterEngine from the same FlutterEngineGroup and I'm using SendPort to communicate between the engines. It works fine in the very first load even though I send the class instances that I have made. But after hot restart, I get error like below in SendPort.send(Data()) and only basic dart types are allowed(int, String...).

Invalid argument(s): Illegal argument in isolate message : (object is a regular Dart Instance)

Expected Behavior

First load before hot restart

I/flutter (21335): REQUEST from ActivityEngine::: 1
I/flutter (21335): RESPONSE from ApplicationEngine::: 2

After hot restart

I/flutter (21335): REQUEST from ActivityEngine::: 1
I/flutter (21335): RESPONSE from ApplicationEngine::: 2

Actual Behavior

First load before hot restart

I/flutter (21335): REQUEST from ActivityEngine::: 1
I/flutter (21335): RESPONSE from ApplicationEngine::: 2

After hot restart

I/flutter (24922): Invalid argument: is a regular instance: Instance of 'Data' #0      _SendPort._sendInternal (dart:isolate-patch/isolate_patch.dart:249:43)
I/flutter (24922): #1      _SendPort.send (dart:isolate-patch/isolate_patch.dart:230:5)
I/flutter (24922): #2      setApplicationEngineReceiver.<anonymous closure> (package:flutter_engine_group_project/isolate_executor.dart:23:27)
I/flutter (24922): #3      _rootRunUnary (dart:async/zone.dart:1414:13)
I/flutter (24922): #4      _CustomZone.runUnary (dart:async/zone.dart:1307:19)
I/flutter (24922): #5      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1216:7)
I/flutter (24922): #6      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
I/flutter (24922): #7      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
I/flutter (24922): #8      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
I/flutter (24922): #9      _StreamController._add (dart:async/stream_controller.dart:648:7)
I/flutter (24922): #10     _StreamController.add (dart:async/stream_controller.dart:596:5)
I/flutter (24922): #11     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:192:26)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published