Description
Description
Just a warning about using Flutter 3.19 on Android 12+.
The Unitywidget will break when a keyboard is openend or the screen is rotated.
It will end up spamming the following error:
E/BufferQueueProducer(17453): [ImageReader-1080x2000f22m4-17453-17](id:442d0000001b,api:1,p:1104,c:17453) dequeueBuffer: BufferQueue has been abandoned
You can only recover from this by fully removing the UnityWidget from the widget tree.
This does not happen on Android 11 and lower.
The Flutter 3.20 beta and master channel fix this bug, but that introduces another Unity bug.
Flutter now resizes the platform view and Unity can't seem to handle that. It will resize to the wrong size.
Workarounds
[UPDATE] Flutter 3.22 fixes the issue and can be used without workaround.
You've got 4 choices for now:
- use Flutter up to 3.13.9
- Use Flutter Up to 3.16.9 (with bug on Android < 8)
- use
useAndroidViewSurface: true
- use 3.20 beta and don't use rotation or keyboard
Video
The red color is a container behind the unitywidget, to show when it is transparent or invisible.
The 3.19 videos were recorded on an earlier beta, but you get the same visual result on 3.19 stable.
S20FE Keyboard open videos
1: 3.16 | 2: 3.19 | 3: master (3.20) |
---|---|---|
S20FE_3.16_keyboard.mp4 |
S20FE_3.19_keyboard.mp4 |
S20FE_master_keyboard.mp4 |
Screen rotation videos
4: 3.16 | 5: 3.19 | 6: master (3.20) |
---|---|---|
S20FE_3.16_rotate.mp4 |
S20FE_3.19_rotate.mp4 |
S20FE_master_rotate.mp4 |
Versions
- Unity: This applies to all Unity versions
- Flutter: 3.19 stable
- Android: Android 12 and up.