alibaba / alibaba/flutter_boost

Android机当长期放置或者开启应用过多时,会导致flutter引擎中的dart runtime被清理,导致页面空白

Open
#862 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
7.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

## Steps to Reproduce

1. 直接打开软件,从原生页面跳转到flutter页面(可能触发)
2. 打开软件,再打开其它软件把手机内存占满,再打开软件极有可能触发

**Flutter Boost Version** 1.12.13.hotfix9
**Target Platform:** Android
**Target OS version/browser:** Android5.1(API22)
**Devices:** ZTEBA611C

## 猜测原因

目前debug下来看,出现这种情况下,dart 的runtime已经不在内存中了(猜测是被系统清理了),不过Android端的flutterEngine还正常在内存中,并且其中flutterJNI及dartExecutor都正常,所以无法感知dart runtime不在内存中,导致了页面空白

## Logs
add your crash log or something else.

```
[✓] Flutter (Channel v1.12.13-hotfixes, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287, locale zh-Hans-CN)
• Flutter version 1.12.13+hotfix.9 at /Users/admin/Desktop/Application/flutter
• Framework revision f139b11009 (5 months ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /usr/local/Caskroom/android-sdk/4333796
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /usr/local/share/android-sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.7)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.7, Build version 11E801a
• CocoaPods version 1.9.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.48.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.14.0

[✓] Connected device (4 available)
• ZTE BA611C • ZTEBA611C • android-arm64 • Android 5.1 (API 22)
• iPhone XR • 6CCD6563-7474-4687-9335-78A2A503D264 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-0 (simulator)
• Chrome • chrome • web-javascript • Google Chrome 85.0.4183.83
• Web Server • web-server • web-javascript • Flutter Tools

• No issues found!
```

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Start by reproducing the blank Flutter page on the listed Android 5.1 device using the memory-pressure steps, then inspect the Android FlutterEngine and Dart runtime lifecycle described in the report. Done means the runtime-loss case is detected and the page no longer remains blank.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.