-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.
Description
Android Code:
class MainActivity: FlutterActivity() {
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
val basicBinary =
BasicMessageChannel(flutterEngine.dartExecutor, "dev.flutter.echo.basic.binary", BinaryCodec.INSTANCE)
basicBinary.setMessageHandler { message, reply -> reply.reply(message) }
super.configureFlutterEngine(flutterEngine)
}
}
Flutter Code:
const BasicMessageChannel<ByteData> basicBinary =
BasicMessageChannel<ByteData>(
'dev.flutter.echo.basic.binary',
BinaryCodec(),
);
int size = 0;
for (int i = 0; i < _numMessages; ++i) {
final ByteData result = await basicBinary.send(encodedLargeBuffer);
size += (result == null) ? 0 : result.lengthInBytes;
}
if (size != encodedLargeBuffer.lengthInBytes * _numMessages) {
throw Exception(
'There is an error with the echo channel, the results don\'t add up: $size');
}
Seen result:
result
is not null, but the lengthInBytes
is zero. The exception is getting thrown.
Expected result:
result
should be equal to encodedLargeBuffer
. This works on iOS, not on Android.
Debugging Info:
I was able to verify that the data is getting received correctly in the channel's handler. I followed the data all the way in the Java debugger and everything looks good. It seems the data is getting lost in the layer below that.
Reproduction Code:
I discovered the problem when authoring #81874
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.