Skip to content

Platform views throw fatal exception: Methods marked with @UiThread must be executed on the main thread #96661

@stuartmorgan-g

Description

@stuartmorgan-g

Filing for tracking since the plugin tree is closed.

Capturing from discussion in Discord, the failure is not a test failure but an engine exception:

[ERROR:flutter/fml/platform/android/jni_util.cc(211)] java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: 1.raster
01-13 13:15:51.647: E/flutter(26324):     at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:1405)
01-13 13:15:51.647: E/flutter(26324):     at io.flutter.embedding.engine.FlutterJNI.destroyOverlaySurfaces(FlutterJNI.java:1174)

From @blasten:

it's coming from https://github.com/flutter/engine/blob/2db35079836e4bdd173f5228ffd18c47789e2113/shell/common/rasterizer.cc#L102 . At the end, we change the thread configuration, and causes this issue

and

https://github.com/flutter/engine/pull/30724/files made this issue more likely to occur

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressiona: platform-viewsEmbedding Android/iOS views in Flutter appsengineflutter/engine related. See also e: labels.packageflutter/packages repository. See also p: labels.platform-androidAndroid applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions