Minimal repro for flutter/flutter#193428. It uses Flutter only, with no plugins.
On Flutter 3.47, MediaTek + Mali phones with ro.vendor.build.version.sdk < 32 use Impeller OpenGLES instead of Vulkan. On those phones, Image.toByteData() (io thread) running at the same time as Picture.toImage() (raster thread) on the same images freezes the app. Either one alone does not.
flutter build apk --release
Install it on an affected phone and tap Start freeze test. The app freezes within about a minute, and logcat shows:
E REPRO : MAIN THREAD BLOCKED for 5004ms
E REPRO : at io.flutter.embedding.engine.FlutterJNI.nativeSurfaceDestroyed(Native Method)
The first screen shows whether the phone is affected (MediaTek, Mali GPU, vendor SDK, and the Impeller backend in use).
Tested on Firebase Test Lab austin (moto g 5G 2022, MT6833, Mali-G57), where it froze in every run:
gcloud firebase test android run --type game-loop \
--app build/app/outputs/flutter-apk/app-release.apk \
--device model=austin,version=33 --timeout 10m
- Shows a grid of rotating images.
- Calls
toByteData()on those images in a loop. - Draws the same images into a small
Pictureand callstoImage()in a loop. - Briefly covers the app every 3 s, so Flutter's surface is destroyed and recreated.
--dart-define=READBACK=false turns off the toByteData() loops, for a control run that does not freeze.