Content-Length: 379819 | pFad | https://github.com/flutter/flutter/issues/162147

35 Flutter 3.27.x | Android 10, 11 | Crash: "drawRenderNode called on a context with no surface!" · Issue #162147 · flutter/flutter · GitHub
Skip to content

Flutter 3.27.x | Android 10, 11 | Crash: "drawRenderNode called on a context with no surface!" #162147

@namnh-0652

Description

@namnh-0652

Steps to reproduce

Issue Summary:

Our app uses multiple screens with WebView (flutter_inappwebview). After upgrading Flutter from version 3.24.4 to 3.27.1 to address this issue on iOS 18.2, we started receiving a large number of crash reports on Android.

Steps to Reproduce:

  1. Open and close multiple WebView screens (approximately 5–10 screens).
  2. Open another WebView screen. While it attempts to render, press the Home button to minimize the app.
  3. Reopen the app from the background right after that.
  4. Observed Behavior: The app shows a black screen, ANR logs, and then crashes.

Additional Notes:

1. Impeller Disabled:
Due to this issue, Impeller is disabled on Android:

<meta-data
    android:name="io.flutter.embedding.android.EnableImpeller"
    android:value="false" />

2. Crash Details:

  • Crashes occur 100% of the time on devices running Android 10 and 11.
  • Tested builds:
    • Flutter 3.24.4 & 3.24.5: No crashes observed on a Nokia 8.1 (Android 11).
    • Flutter 3.27.1 & 3.27.3: Crashes consistently occur on the same device (Nokia 8.1, Android 11).

Expected results

Android app should not be crashed

Actual results

App crashes

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs

Android 11:

drawRenderNode called on a context with no surface!
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 30834 >>> my.app.package <<<

backtrace:
  #00  pc 0x000000000004e40c  /apex/com.android.runtime/lib64/bionic/libc.so (abort+164)
  #01  pc 0x000000000055d00c  /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+2308)
  #02  pc 0x0000000000013978  /system/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+76)
  #03  pc 0x0000000000006e18  /system/lib64/liblog.so (__android_log_assert+336)
  #04  pc 0x0000000000215014  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::getFrame()+52)
  #05  pc 0x000000000021df14  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+188)
  #06  pc 0x0000000000220608  /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+508)
  #07  pc 0x000000000020ed94  /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+220)
  #08  pc 0x000000000023007c  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+88)
  #09  pc 0x00000000000154cc  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+260)
  #10  pc 0x0000000000014d90  /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+412)
  #11  pc 0x00000000000b0048  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)
  #12  pc 0x00000000000503c8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

Android 10:

drawRenderNode called on a context with no surface!
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 24468 >>> my.app.package <<<

backtrace:
  #00  pc 0x00000000000830f0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160)
  #01  pc 0x0000000000008a14  /system/lib64/liblog.so (__android_log_assert+328)
  #02  pc 0x00000000002c6dd0  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::getFrame()+48)
  #03  pc 0x00000000002d3a00  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+236)
  #04  pc 0x00000000002d2cc0  /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+380)
  #05  pc 0x00000000002de238  /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+228)
  #06  pc 0x00000000002ddf20  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+588)
  #07  pc 0x0000000000013654  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+328)
  #08  pc 0x00000000000e68a0  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
  #09  pc 0x0000000000084b6c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

Full ARN aborting log:

report-crash.log

See attachment

Flutter Doctor output

Doctor output
[Paste your output here]

Image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsc: crashStack traces logged to the consolee: OS-version specificAffects only some versions of the relevant operating systemplatform-androidAndroid applications specificallyslimpellerEngine binary size reduction. go/slimpellerteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/flutter/flutter/issues/162147

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy