Repository navigation
drawRenderNode called on a context with no surface! #112254
Copy link
Copy link
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsc: crashStack traces logged to the consoleStack traces logged to the consolec: fatal crashCrashes that terminate the processCrashes that terminate the processcustomer: triviae: device-specificOnly manifests on certain devicesOnly manifests on certain devicesengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.3Found to occur in 3.3Found to occur in 3.3has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
Scene
- Custom FlutterEngine instance created by the developer is used in FlutterActivity
- Flutter UI uses PlatformView
Steps to Reproduce
- Open developer mode, Turn on the 'Don't keep activities' option
- Open the app, Press the button to jump to FlutterActivity page
- Turn the app to the background, open another app (several apps are better )
- Turn the app to foreground and the app will crash
Code sample
Logs
Crash Log : https://github.com/a1017480401/crash_demo/blob/main/crash_log
[√] Flutter (Channel stable, 3.3.2, on Microsoft Windows [版本 10.0.19044.2006], locale zh-CN)
• Flutter version 3.3.2 on channel stable at D:\code\flutter\SDK\flutter_windows_3.3.0-stable\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e3c29ec00c (9 days ago), 2022-09-14 08:46:55 -0500
• Engine revision a4ff2c53d8
• Dart version 2.18.1
• DevTools version 2.15.0
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at D:\code\android\AndroidSDK
• Platform android-33, build-tools 32.1.0-rc1
• Java binary at: D:\code\android\AS\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.6)
• Visual Studio at D:\tools\Visual Studio\2022\Components
• Visual Studio Community 2022 version 17.1.32421.90
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 2021.2)
• Android Studio at D:\code\android\AS
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
[√] Connected device (5 available)
• V2055A (mobile) • 343470231100DGT • android-arm64 • Android 11 (API 30)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 31) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.19044.2006]
• Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.127
• Edge (web) • edge • web-javascript • Microsoft Edge 105.0.1343.27
[√] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsc: crashStack traces logged to the consoleStack traces logged to the consolec: fatal crashCrashes that terminate the processCrashes that terminate the processcustomer: triviae: device-specificOnly manifests on certain devicesOnly manifests on certain devicesengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.3Found to occur in 3.3Found to occur in 3.3has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Activity
Passer-by commentedon Sep 23, 2022
similar with this issue #103870
I've made some special handle for this issue
https://github.com/a1017480401/crash_demo/blob/main/android/app/src/main/kotlin/com/example/crash_demo/MainActivity.kt#L11-L13
FlutterRenderer.onTrimMemory seems to be from flutter-team-archive/engine@031fa76
exaby73 commentedon Sep 23, 2022
Trying to run the android project, I get the following error.
Not sure what the issue is. But I'll still label this issue for further insights from the team.
Passer-by commentedon Sep 23, 2022
Sorry, this crash is not the same as mine and I think this crash has nothing to do with Flutter
exaby73 commentedon Sep 23, 2022
This crash is appearing when clicking on the button and the Flutter view loads. Not in the way you are describing :)
Passer-by commentedon Sep 23, 2022
wait for me to try my demo again
Passer-by commentedon Sep 23, 2022
48EFB7978BB91E88218423712C4835B5.mp4
Passer-by commentedon Sep 25, 2022
I apologize for my carelessness.
I updated the demo(webview_flutter -> inappwebview add network permissions ) and provided a video of the crash
exaby73 commentedon Sep 26, 2022
These are the error logs I am getting after using your latest code. Though the app is crashing before I actually get into the foreground (observed through the terminal).
Logs (tail)
59 remaining items
felipecastrosales commentedon Apr 30, 2024
Hi @chinmaygarde.
I saw you marked it as P2, shouldn't this be marked as P0? Considering the numerous appearances and reports about this problem and the consequence of it (crash in production)?
Also, I find it very suspicious because it appeared from 3.3.0 onwards; Was there any specific change that caused this?
johnmccutchan commentedon Apr 30, 2024
@felipecastrosales This is a device-specific bug that no one can reproduce except for some users in the wild running off-brand Android phones.
Until we have a reproduction that the Flutter team can use progress will be slow.
johnmccutchan commentedon Apr 30, 2024
A more interesting experiment would be to see if it still happens in 3.22
fernan88 commentedon Apr 30, 2024
@johnmccutchan The steps to reproduce are outlined above (#112254 (comment)) the only requirement is to use one of the listed devices(Samsung SM-A032M, MotoG13, MotoG23).
The issue persists in Flutter 3.19.6 but we have tried in Flutter 3.22.0-0.3.pre and is not crashing anymore in the Samsung SM-A032M device.
@johnmccutchan would you validate this fix please? because we need to solve this as soon as possible (we have 4k affected user in 10 days and 1k crashes everyday).
johnmccutchan commentedon Apr 30, 2024
Sounds like this is fixed in 3.22, we recommend people upgrade.
YuxuanDu commentedon Apr 30, 2024
It's good to hear it has been fixed in 3.22. Another question would be when will 3.22 be released on Stable channel. @johnmccutchan
westy92 commentedon Apr 30, 2024
@YuxuanDu based on history, it will be released by 5/14 for Google I/O.
Gilianp commentedon May 1, 2024
I hope this bug has finally been fixed. Although few devices are affected, such devices have a large number of users, especially Samsung. With me, according to Play Console, only the Samsung A03 Core, in production, raises the crash rate above the tolerated limit of 8%, making the app subject to punishment
mmga commentedon May 6, 2024
@fernan88 Hi, what is the Android version of your SM-A032 device ?
fernan88 commentedon May 6, 2024
Hi Bian, this is an Android 13 OS.
Gilianp commentedon May 13, 2024
3.22 is now released in stable
github-actions commentedon May 28, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.