TF-4099 Mobile adding an attachment causes composer UI issues #4100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
#4099
Root cause
This is a typical crash of Android WebView renderer being
OOM (Out Of Memory)or being force-killed due tolow-memorypolicy.Special:
Confirmed MIUI (system_server) killed the process to reclaim memory, as the device recognized it as a “lowmemory device”.
flutter_inappwebviewcreates its own sandbox renderer (Chromium engine) -> consumes a lot of RAM.When file_picker turns on
Intent.ACTION_OPEN_DOCUMENT, Android temporarily switches foreground to another app → causing MIUI or Android low-memory killer to think your app is in the background → kill WebView renderer.Then WebView cannot recover because Chromium sandbox is dead → Flutter is terminated.
Workaround
android:largeHeap="true"in AndroidManifest => Allow process to keep more RAM, limit OOM kill when DocumentsUI is open.