Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 9: App crashes if hardware acceleration is enabled #575

Closed
danielang opened this issue May 16, 2019 · 50 comments
Closed

Android 9: App crashes if hardware acceleration is enabled #575

danielang opened this issue May 16, 2019 · 50 comments

Comments

@danielang
Copy link

danielang commented May 16, 2019

Bug description:
Our app crashes on Android 9 if the hardware acceleration was used in the webview.
If I disable the hardware acceleration on the embedded webviews the app works fine.
If I disable the acceleration in the AndroidManifest the app also works without crashes.
So I think it has something to do with the webview implementation and their usage of the hardware acceleration on Android 9.

To Reproduce:
The bug occurse in our currently productive app. The repository could be found here: postillonmedia/app

Expected behavior:
The app should not crash when the acceleration is enabled 😄

Screenshots/Videos/Traces:
Current reports of the Google-Play console
image

One of the traces:

05-14 23:07:01.963 10286  7866 22340 W com.postillon: 0xebadde09 skipped times: 0
05-14 23:07:01.964 10286  7866 22340 F libc    : Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c in tid 22340 (RenderThread), pid 7866 (com.postillon)
05-14 23:07:02.049 10286 22987 22987 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
05-14 23:07:02.051  1058  5437  5437 I /system/bin/tombstoned: received crash request for pid 22340
05-14 23:07:02.052 10286 22987 22987 I crash_dump32: performing dump of process 7866 (target tid = 22340)
05-14 23:07:02.065 10286 22987 22987 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-14 23:07:02.065 10286 22987 22987 F DEBUG   : Build fingerprint: 'samsung/beyond2lteeea/beyond2:9/PPR1.180610.011/G975FXXU1ASD5:user/release-keys'
05-14 23:07:02.065 10286 22987 22987 F DEBUG   : Revision: '26'
05-14 23:07:02.065 10286 22987 22987 F DEBUG   : ABI: 'arm'
05-14 23:07:02.065 10286 22987 22987 F DEBUG   : pid: 7866, tid: 22340, name: RenderThread  >>> com.postillon <<<
05-14 23:07:02.065 10286 22987 22987 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1c
05-14 23:07:02.065 10286 22987 22987 F DEBUG   : Cause: null pointer dereference
05-14 23:07:02.065 10286 22987 22987 F DEBUG   :     r0  00000000  r1  e1b50d80  r2  eb08606d  r3  00000000
05-14 23:07:02.065 10286 22987 22987 F DEBUG   :     r4  00000000  r5  00000000  r6  a7aee7e0  r7  00000000
05-14 23:07:02.065 10286 22987 22987 F DEBUG   :     r8  00000000  r9  00000000  r10 00000000  r11 00000000
05-14 23:07:02.065 10286 22987 22987 F DEBUG   :     ip  eb5a3914  sp  c82b9fe0  lr  eaffcabd  pc  eb35e4b4
05-14 23:07:02.112 10286 22987 22987 F DEBUG   : 
05-14 23:07:02.112 10286 22987 22987 F DEBUG   : backtrace:
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #00 pc 003f14b4  /system/lib/libhwui.so (SkSurface::getCanvas()+4)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #01 pc 0008fab9  /system/lib/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+1192)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #02 pc 0035a3b5  /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+212)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #03 pc 0035a967  /system/lib/libhwui.so (SkLiteDL::draw(SkCanvas*) const+154)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #04 pc 0034273d  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+272)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #05 pc 00342a53  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+202)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #06 pc 0035a345  /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+100)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #07 pc 0035a967  /system/lib/libhwui.so (SkLiteDL::draw(SkCanvas*) const+154)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #08 pc 0034273d  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+272)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #09 pc 00342a53  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+202)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #10 pc 0035a345  /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+100)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #11 pc 0035a967  /system/lib/libhwui.so (SkLiteDL::draw(SkCanvas*) const+154)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #12 pc 0034273d  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+272)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #13 pc 00342a53  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+202)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #14 pc 0035a345  /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+100)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #15 pc 0035a967  /system/lib/libhwui.so (SkLiteDL::draw(SkCanvas*) const+154)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #16 pc 0034273d  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+272)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #17 pc 00342a53  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+202)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #18 pc 0035a345  /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+100)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #19 pc 0035a967  /system/lib/libhwui.so (SkLiteDL::draw(SkCanvas*) const+154)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #20 pc 0034273d  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+272)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #21 pc 00342a53  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+202)
05-14 23:07:02.112 10286 22987 22987 F DEBUG   :     #22 pc 0035a345  /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+100)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #23 pc 0035a967  /system/lib/libhwui.so (SkLiteDL::draw(SkCanvas*) const+154)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #24 pc 0034273d  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+272)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #25 pc 00342a53  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+202)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #26 pc 0035a345  /system/lib/libhwui.so (SkDrawable::draw(SkCanvas*, SkMatrix const*)+100)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #27 pc 0035a967  /system/lib/libhwui.so (SkLiteDL::draw(SkCanvas*) const+154)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #28 pc 0034273d  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::drawContent(SkCanvas*) const+272)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #29 pc 00342a53  /system/lib/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+202)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #30 pc 00097a0d  /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderLayersImpl(android::uirenderer::LayerUpdateQueue const&, bool, bool)+812)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #31 pc 00374d81  /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderFrame(android::uirenderer::LayerUpdateQueue const&, SkRect const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, bool, bool, android::uirenderer::Rect const&, sk_sp<SkSurface>)+40)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #32 pc 00374497  /system/lib/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::draw(android::uirenderer::renderthread::Frame const&, SkRect const&, SkRect const&, android::uirenderer::FrameBuilder::LightGeometry const&, android::uirenderer::LayerUpdateQueue*, android::uirenderer::Rect const&, bool, bool, android::uirenderer::BakedOpRenderer::LightInfo const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #33 pc 000a0963  /system/lib/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+150)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #34 pc 00377791  /system/lib/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+576)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #35 pc 00341a9b  /system/lib/libhwui.so (android::uirenderer::WorkQueue::process()+122)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #36 pc 000aa13f  /system/lib/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+178)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #37 pc 0000c08b  /system/lib/libutils.so (android::Thread::_threadLoop(void*)+166)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #38 pc 00064949  /system/lib/libc.so (__pthread_start(void*)+140)
05-14 23:07:02.113 10286 22987 22987 F DEBUG   :     #39 pc 0001e3c5  /system/lib/libc.so (__start_thread+24)

Environment:

  • OS: Android
  • OS version: 9
  • react-native version: 0.59.8
  • react-native-webview version: 5.8.2

Known devices

  • Galaxy Note9 (crownlte)

  • Galaxy Note8 (greatlte)

  • Galaxy S9 (starlte)

  • Galaxy S9+ (star2lte)

  • Galaxy S8 (dreamlte)

  • Galaxy S8+ (dream2lte)

  • P20 Pro (HWCLT)

  • Mate 10 Pro (HWBLA)

  • Mate 20 Pro (HWLYA)

  • P20 (HWEML)

  • Mate 20 (HWHMA)

  • Honor 10 (HWCOL)

  • Honor Play (HWCOR)

  • Mate 10 (HWALP)

  • Honor V10 (HWBKL)

  • P10 (HWVTR)

  • Honor 9 (HWSTF)

  • Honor 8X (HWJSN-H)

  • HONOR V20 (HWPCT)

  • HUAWEI P smart 2019 (HWPOT-H)

  • Mate 9 (HWMHA)

  • HUAWEI P30 lite (HWMAR)

  • Honor 10 Lite (HWHRY-H)

  • P10 Plus (HWVKY)

  • Mate 20 lite (HWSNE)

  • Xperia XZ1 Compact (G8441)

  • Xperia XZ1 (G8341)

  • Xperia XA2 (H3113)

  • Xperia XZ Premium (G8141)

  • Xperia XA2 Ultra (H4213)

  • Xperia 10 (I4113)

  • Pixel (sailfish)

  • Pixel 2 (walleye)

  • Pixel 2 XL (taimen)

  • Pixel 3 (blueline)

  • Pixel 3 XL (crosshatch)

  • moto g(6) (ali_n)

  • moto g(6) plus (evert_n)

  • moto g(6) play (aljeter)

All devices runs Android 9

@danielang
Copy link
Author

Hello @Titozzz,
could you please take a look at this issue. Is our app an individual case or does other users also have problems on Android 9?
Thank you!

@MaxMaes
Copy link

MaxMaes commented May 22, 2019

Same issue here, works fine on older android versions but crashes on Android 9 and disabling hardware acceleration 'fixes' it.

The content i have on my screen are 3 youtube iframes. Tried with 5.10.0.

@entropitor
Copy link

This is probably related to facebook/react-native#24261

@danielang
Copy link
Author

No, I don't think so.
I currently use realm in my app, which doesn't support x64 when this bug appears. So the 64 Bit buiild was disabled as I submitted this issue. In the mean time realm supports x64 and the issue is still there.

I've used react-native-navigation [v1]. In my desperation I convert my app to the newer v2 version of rnn. Sadly the bug is still there, BUT if I disable the navigation animations, which is not really possible in rnn v1, the bug was worked around.

So I think there must be an issue in the WebView, when it was animated and (un)mounted in the same time.

@MaxMaes: Which navigation library did you use?

@Titozzz
Copy link
Collaborator

Titozzz commented Jun 2, 2019

@danielang I'm very sorry that your app is affected by this bug. If you find a solution, I'll be glad to review and merge it. 😍

@MaxMaes
Copy link

MaxMaes commented Jun 3, 2019

No, I don't think so.
I currently use realm in my app, which doesn't support x64 when this bug appears. So the 64 Bit buiild was disabled as I submitted this issue. In the mean time realm supports x64 and the issue is still there.

I've used react-native-navigation [v1]. In my desperation I convert my app to the newer v2 version of rnn. Sadly the bug is still there, BUT if I disable the navigation animations, which is not really possible in rnn v1, the bug was worked around.

So I think there must be an issue in the WebView, when it was animated and (un)mounted in the same time.

@MaxMaes: Which navigation library did you use?

react-native-navigation, latest release (but also happens with earlier minors of v2).

@Embraser01
Copy link

Hey! Disabling hardware acceleration seems to fix it but embedded videos doesn't work anymore 😢

The app also uses RNN so, I'll try disabling animations and see if it work...

@Embraser01
Copy link

So disabling the animations in react-native-navigation seems to fix the issue. Thanks @danielang!

I used this in order to fix the crash (and keep animations if supported):

  const hasAnimation = () => DeviceInfo.getAPILevel() !== 28;
  Navigation.setDefaultOptions({
    [...],
    animations: {
      dismissModal: { enabled: hasAnimation() },
      pop: { enabled: hasAnimation() },
      push: { enabled: hasAnimation() },
      setRoot: { enabled: hasAnimation() },
      showModal: { enabled: hasAnimation() },
    },
  })

I don't know if it works in Android Q (API 29) so maybe a DeviceInfo.getAPILevel() > 28 would be better

@ouabing
Copy link

ouabing commented Jun 27, 2019

I'm using react-navigation, but still facing this problem and #623 . With hardware acceleration disabled, embedded videos will not play anymore(only sound will play), so I don't think it's a valid workaround for me : (.

@Embraser01 Do you have any clue how disabling the animations in react-native-navigation fixes this issue?

@Embraser01
Copy link

@Embraser01 Do you have any clue how disabling the animations in react-native-navigation fixes this issue?
Don't really know... As far as I know, it could be related to the fact that the webview tries to display the page on a view that is not created yet (during the animation), resulting in a null exception

@dimasdanz
Copy link

Got the same issue here (Android 8, RN 0.59.10, RNN 2.22.3), one way to "fix" it without disabling animation on react-native-navigation or disabling it, application wide (via android:hardwareAccelerated="false" on manifest) is to just disable hw acceleration only on webview by setting androidHardwareAccelerationDisabled prop

<WebView
  androidHardwareAccelerationDisabled
  source={source}
/>

@ouabing
Copy link

ouabing commented Jul 6, 2019

@dimasdanz disabling hardwareAccelerated, some videos won't play anymore : (

@dimasdanz
Copy link

@ouabing yeah, seems video tag videos only plays the audio while displaying a constant gray screen.

@w-
Copy link

w- commented Aug 25, 2019

wow. i just wasted 3 hours of my life on this. Can we get something in the readme until this is fixed? It is a common enough pattern to use react-native-navigation that I'm sure this is a widespread issue.

@ddcrobert
Copy link

Disabling hardware acceleration isn't always a good solution. If you can't predict the weight of your webview content (especially embeds), you can then have software layer issues. And I'm not sure there is a workaround for that nor it can be increased (something like largeHeap).
RNCWebView not displayed because it is too large to fit into a software layer (or drawing cache), needs 34285680 bytes, only 9331200 available

thanakij added a commit to thanakij/react-native-webview that referenced this issue Sep 8, 2019
@thanakij
Copy link
Contributor

thanakij commented Sep 8, 2019

Hey @dimasdanz, can you help verify the PR to see if this resolves the issue.

@react-native-community-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 7.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

ALEEF02 added a commit to ALEEF02/Bulletin-Magazine-Mobile-App that referenced this issue Nov 15, 2019
@ItsNoHax
Copy link

I am still running into this using the latest version of webview :/

@henrymoulton
Copy link

Will do. cc @daniocean

@deepakd-iprogrammer
Copy link

facing the same prob,disabling hardware acceleration makes the webview responsiveness laggy which is undesirable but is solving the crash issue.

@Rohansi
Copy link

Rohansi commented Apr 18, 2020

04-17 20:09:16.313 20833 20833 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-17 20:09:16.313 20833 20833 F DEBUG   : Build fingerprint: 'samsung/beyond2qltecs/beyond2q:10/QP1A.190711.020/G975WVLS3CTA3:user/release-keys'
04-17 20:09:16.313 20833 20833 F DEBUG   : Revision: '17'
04-17 20:09:16.313 20833 20833 F DEBUG   : ABI: 'arm64'
04-17 20:09:16.313 20833 20833 F DEBUG   : Timestamp: 2020-04-17 20:09:16-0400
04-17 20:09:16.313 20833 20833 F DEBUG   : pid: 20565, tid: 20629, name: RenderThread  >>> com.company.app.name <<<
04-17 20:09:16.313 20833 20833 F DEBUG   : uid: 10307
04-17 20:09:16.313 20833 20833 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
04-17 20:09:16.313 20833 20833 F DEBUG   : Cause: null pointer dereference
04-17 20:09:16.313 20833 20833 F DEBUG   :     x0  0000000000000000  x1  0000007a157cb0b4  x2  0000000000000002  x3  0000007915c2c7a8
04-17 20:09:16.313 20833 20833 F DEBUG   :     x4  0000000000000003  x5  0000000000000005  x6  0000007a154fae90  x7  0000007a154fae82
04-17 20:09:16.313 20833 20833 F DEBUG   :     x8  0000000000000000  x9  0000000000000000  x10 0000007a18550900  x11 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x12 000000000000002a  x13 0000000000000000  x14 0000007a154fb245  x15 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x16 0000007a15bcd560  x17 0000007a15776324  x18 000000790c386000  x19 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x20 00000078f6431308  x21 0000000000000000  x22 0000000000000008  x23 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x24 0000007915c2c830  x25 0000007915c38020  x26 0000000000000000  x27 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x28 0000000000000000  x29 0000007915c2c770
04-17 20:09:16.314 20833 20833 F DEBUG   :     sp  0000007915c2c760  lr  0000007a156d9f0c  pc  0000007a15776334
04-17 20:09:16.343 20833 20833 F DEBUG   :
04-17 20:09:16.343 20833 20833 F DEBUG   : backtrace:
04-17 20:09:16.343 20833 20833 F DEBUG   :       #00 pc 00000000003a7334  /system/lib64/libhwui.so (SkSurface::getCanvas()+16) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #01 pc 000000000030af08  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+940) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #02 pc 00000000004fd9f8  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+276) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #03 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #04 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #05 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #06 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #07 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #08 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #09 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #10 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #11 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #12 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #13 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #14 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #15 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #16 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #17 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #18 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #19 pc 00000000003823c8  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+300) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #20 pc 0000000000381ddc  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+484) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #21 pc 00000000003a9a44  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderLayersImpl(android::uirenderer::LayerUpdateQueue const&, bool)+516) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #22 pc 00000000003a6e3c  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderFrame(android::uirenderer::LayerUpdateQueue const&, SkRect const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, bool, android::uirenderer::Rect const&, sk_sp<SkSurface>, SkMatrix const&)+104) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #23 pc 00000000003a6aa8  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::draw(android::uirenderer::renderthread::Frame const&, SkRect const&, SkRect const&, android::uirenderer::LightGeometry const&, android::uirenderer::LayerUpdateQueue*, android::uirenderer::Rect const&, bool, android::uirenderer::LightInfo const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, android::uirenderer::FrameInfoVisualizer*)+388) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #24 pc 0000000000403b24  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+660) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #25 pc 0000000000402d18  /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+380) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #26 pc 000000000040d364  /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+228) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #27 pc 000000000040d04c  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+584) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #28 pc 00000000000135f0  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+328) (BuildId: 87f74d8753bc7b1302b8b8f9b593fa9c)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #29 pc 00000000000e6f10  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 55ce0a7d78144b0290f9746ed1615719)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #30 pc 00000000000850c8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 55ce0a7d78144b0290f9746ed1615719)

Same situation with a WebView opening in a React Navigation stack. Running in Expo SDK 37 so it's react-native-webview@8.1.1. Latest React Navigation 5.

Also I only get this crash on a Samsung S10+ (Android 10). My Moto e5 cruise (Android 8) does not get it.

@thanakij
Copy link
Contributor

04-17 20:09:16.313 20833 20833 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
04-17 20:09:16.313 20833 20833 F DEBUG   : Build fingerprint: 'samsung/beyond2qltecs/beyond2q:10/QP1A.190711.020/G975WVLS3CTA3:user/release-keys'
04-17 20:09:16.313 20833 20833 F DEBUG   : Revision: '17'
04-17 20:09:16.313 20833 20833 F DEBUG   : ABI: 'arm64'
04-17 20:09:16.313 20833 20833 F DEBUG   : Timestamp: 2020-04-17 20:09:16-0400
04-17 20:09:16.313 20833 20833 F DEBUG   : pid: 20565, tid: 20629, name: RenderThread  >>> com.company.app.name <<<
04-17 20:09:16.313 20833 20833 F DEBUG   : uid: 10307
04-17 20:09:16.313 20833 20833 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x20
04-17 20:09:16.313 20833 20833 F DEBUG   : Cause: null pointer dereference
04-17 20:09:16.313 20833 20833 F DEBUG   :     x0  0000000000000000  x1  0000007a157cb0b4  x2  0000000000000002  x3  0000007915c2c7a8
04-17 20:09:16.313 20833 20833 F DEBUG   :     x4  0000000000000003  x5  0000000000000005  x6  0000007a154fae90  x7  0000007a154fae82
04-17 20:09:16.313 20833 20833 F DEBUG   :     x8  0000000000000000  x9  0000000000000000  x10 0000007a18550900  x11 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x12 000000000000002a  x13 0000000000000000  x14 0000007a154fb245  x15 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x16 0000007a15bcd560  x17 0000007a15776324  x18 000000790c386000  x19 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x20 00000078f6431308  x21 0000000000000000  x22 0000000000000008  x23 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x24 0000007915c2c830  x25 0000007915c38020  x26 0000000000000000  x27 0000000000000000
04-17 20:09:16.314 20833 20833 F DEBUG   :     x28 0000000000000000  x29 0000007915c2c770
04-17 20:09:16.314 20833 20833 F DEBUG   :     sp  0000007915c2c760  lr  0000007a156d9f0c  pc  0000007a15776334
04-17 20:09:16.343 20833 20833 F DEBUG   :
04-17 20:09:16.343 20833 20833 F DEBUG   : backtrace:
04-17 20:09:16.343 20833 20833 F DEBUG   :       #00 pc 00000000003a7334  /system/lib64/libhwui.so (SkSurface::getCanvas()+16) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #01 pc 000000000030af08  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::GLFunctorDrawable::onDraw(SkCanvas*)+940) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #02 pc 00000000004fd9f8  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+276) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #03 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #04 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #05 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #06 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #07 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #08 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #09 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #10 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #11 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #12 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #13 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #14 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #15 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #16 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.343 20833 20833 F DEBUG   :       #17 pc 000000000037c3e4  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::onDraw(SkCanvas*)+784) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #18 pc 00000000004fd994  /system/lib64/libhwui.so (SkCanvas::onDrawDrawable(SkDrawable*, SkMatrix const*)+176) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #19 pc 00000000003823c8  /system/lib64/libhwui.so (android::uirenderer::DisplayListData::draw(SkCanvas*) const+300) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #20 pc 0000000000381ddc  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::RenderNodeDrawable::forceDraw(SkCanvas*)+484) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #21 pc 00000000003a9a44  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderLayersImpl(android::uirenderer::LayerUpdateQueue const&, bool)+516) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #22 pc 00000000003a6e3c  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaPipeline::renderFrame(android::uirenderer::LayerUpdateQueue const&, SkRect const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, bool, android::uirenderer::Rect const&, sk_sp<SkSurface>, SkMatrix const&)+104) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #23 pc 00000000003a6aa8  /system/lib64/libhwui.so (android::uirenderer::skiapipeline::SkiaOpenGLPipeline::draw(android::uirenderer::renderthread::Frame const&, SkRect const&, SkRect const&, android::uirenderer::LightGeometry const&, android::uirenderer::LayerUpdateQueue*, android::uirenderer::Rect const&, bool, android::uirenderer::LightInfo const&, std::__1::vector<android::sp<android::uirenderer::RenderNode>, std::__1::allocator<android::sp<android::uirenderer::RenderNode>>> const&, android::uirenderer::FrameInfoVisualizer*)+388) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #24 pc 0000000000403b24  /system/lib64/libhwui.so (android::uirenderer::renderthread::CanvasContext::draw()+660) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #25 pc 0000000000402d18  /system/lib64/libhwui.so (_ZNSt3__110__function6__funcIZN7android10uirenderer12renderthread13DrawFrameTask11postAndWaitEvE3$_0NS_9allocatorIS6_EEFvvEEclEv$c303f2d2360db58ed70a2d0ac7ed911b+380) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #26 pc 000000000040d364  /system/lib64/libhwui.so (android::uirenderer::WorkQueue::process()+228) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #27 pc 000000000040d04c  /system/lib64/libhwui.so (android::uirenderer::renderthread::RenderThread::threadLoop()+584) (BuildId: 93f0bc3414fd542dea748547177efc21)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #28 pc 00000000000135f0  /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+328) (BuildId: 87f74d8753bc7b1302b8b8f9b593fa9c)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #29 pc 00000000000e6f10  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36) (BuildId: 55ce0a7d78144b0290f9746ed1615719)
04-17 20:09:16.344 20833 20833 F DEBUG   :       #30 pc 00000000000850c8  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 55ce0a7d78144b0290f9746ed1615719)

Same situation with a WebView opening in a React Navigation stack. Running in Expo SDK 37 so it's react-native-webview@8.1.1. Latest React Navigation 5.

Also I only get this crash on a Samsung S10+ (Android 10). My Moto e5 cruise (Android 8) does not get it.

Hi @Rohansi, can you try disabling the animation of react-navigation?

@Rohansi
Copy link

Rohansi commented Apr 19, 2020

Hi @Rohansi, can you try disabling the animation of react-navigation?

Yes, that fixes the crash.

@kilowatt-
Copy link

Still having this issue in 9.3.0.

If you are using react-navigation and want to keep animations, you can use listeners to render the WebView only once the transitions are complete/hide the WebView once a transition starts.

Sample code:

  constructor(props: Props) {
    this.state = {
      showWebView: Platform.OS !== 'android'
    };

    if (Platform.OS === 'android') {
      this.willBlurListener = this.props.navigation.addListener('willBlur', () => {
        this.setState({ showWebView: false });
      });

      this.didFocusListener = this.props.navigation.addListener('didFocus', () => {
        this.setState({ showWebView: true });
      });
    }
  }

 componentWillUnmount() {
 if (Platform.OS === 'android') {
      if (this.willBlurListener) this.willBlurListener.remove();
      if (this.didFocusListener) this.didFocusListener.remove();
    }
 }

  render() {
   return (
          ...
          {this.state.showWebView ? // render web view
           : undefined }
    )
  }

phuongwd pushed a commit to phuongwd/react-native-webview that referenced this issue Apr 29, 2020
* Fix react-native-webview#575

* Check if hardware acceleration is available also

* Alternative way to check isHarewareAccelerated
@Jeevan-Kishore
Copy link

Jeevan-Kishore commented Apr 29, 2020

Disabling the animation in React-Navigation worked for me. If you are on React-Navigation 5, here is how to do it:

<NavigationContainer>
     <Stack.Navigator initialRouteName="HomeScreen">
          <Stack.Screen
            name="HomeScreen"
            component={HomeScreen}
            options={{
              animationEnabled: false,
            }}
          />
     </Stack.Navigator>
</NavigationContainer>

https://stackoverflow.com/a/60241167/2309061

Glad to have found this thread, this gave us a clue that disabling animations could give us a fix.

Our case was slightly different as we were using react-native-screens for perf reasons and unfortunately for us, they had moved the documentation from RNN docs, which is now available here

We got it working after adding stackAnimation key to the options props for each of our screens under Stack.Navigator

<Stack.Screen options={{ stackAnimation: "none" }} name={"screenName"} component={Component} />

@caciobanita
Copy link

caciobanita commented May 22, 2020

Also if you add <WebView androidHardwareAccelerationDisabled /> will work with animationEnabled.

@jasper-fu
Copy link

If you are using react-navigation, try this:

// enableScreens();

which saved us from crash

@florian-milky
Copy link

can we reopen this?

@buffge
Copy link

buffge commented Jun 8, 2020

rn 0.62.2 still have this problem. please reopen this issue

@mCodex
Copy link

mCodex commented Jun 24, 2020

I was having this problem using React-Navigation 4x and 5x. You can try disabling // enableScreens(); as @jasper-fu mentioned above for me it worked.

React-Native: 062.2
React-Navigation: 4x and 5x
React-Native-Webview: 9x and 10x

@SS-In
Copy link

SS-In commented Jun 30, 2020

Check my answer in #1069. It could help.

@GregoryNative
Copy link

Had similar problem with react-navigation and react-native-webview.
Fixed by removing animation for particular screens:

static navigationOptions = () => ({
  animationEnabled: false,
});

@vikasg603
Copy link

In my case, it crashes when the navigation contains params. Weird.

Same with me.
It's weird and not able to debug what we can do here.

@hazelf42
Copy link

hazelf42 commented Feb 5, 2021

Just here to say boy did this bug ever ruin my life for about 2 weeks and cause us to have to move back a launch.

@RodolfoGS
Copy link

I'm having this crash using react-navigation + @react-native-firebase/admob.
I think that sometimes admob show ads on a webview (instead native) and this could be the cause of the crash.
Anyone have a solution to this? Thanks

@BhanaviShukla
Copy link

BhanaviShukla commented Mar 2, 2021

https://sentry.io/share/issue/24df2e5df0df47e299e93a2ada69c94c/

Architectures | [arm64-v8a, armeabi-v7a, armeabi]
Battery Level | 57%
Brand | HUAWEI
Family | RNE-L22
Manufacturer | HUAWEI
Model | RNE-L22 (HUAWEIRNE-L22)
Model Id | HUAWEIRNE-L22
Name | RNE-L22
Simulator | False

Kernel Version | 4.4.23+
Name | Android
Rooted | no
Version | 8.0.0(RNE-L22 8.0.0.356(C636))

I am thinking this is the same issue considering I'm also using Webview with hardware acceleration for a tonne of animations.

@RayKay91
Copy link

RayKay91 commented Mar 13, 2021

This is still an issue on as of March 2021. React Navigation stack screen crashing on android but not on iOS unless the androidHardwareAccelerationDisabled prop passed in to the component or { enableAnimations: Platform.OS === 'ios' ? true : false } is passed into the options for the <Stack.Screen>

@thanakij
Copy link
Contributor

thanakij commented Mar 17, 2021

Below is the options you can try:

(1) <WebView androidLayerType="software" ... />

  • It would work but you will need to bear with the degraded performance instead.
  • Note: Another thing you can try is to set androidLayerType="hardware". It helps for some people.

(2) Disable react-native-screens for Platform.OS == 'android' and/or disable the animations of react-navigation in related screens with the WebView component.

(3) Try to prevent the crash

  • loading: Move HTML content into a state variable and then call setTimeout(this.setState({ html }), 1000) later to assign that variable with the actual value.
  • Note: This is to ensure that the animation would have already finished before the time when WebView comes in.
  • back+hardwareback: Make sure to setState({ html: undefined }) before navigating back (and starting the animation).

(4) Explore some alternatives, like react-native-render-html.

@jocoders
Copy link

I have the similar crash on Android 10 Huawei and Xiaomi devices with react-native 0.63.2, react-native-webview: ^9.2.2:

Crashed: Thread : SIGSEGV 0x0000000000000010
#00 pc 0x73121a9748 libjsc.so
#1 pc 0x73121f5fe8 libjsc.so
#2 pc 0x7407046ba8 libc.so

Any ideas how to solve it?

@portiz-daitan
Copy link

The androidHardwareAccelerationDisabled is deprecated. For me, it worked just by changing androidLayerType="software".
But on Android 11, it doesn't work for inline videos (just for full screen). So, the only solution was to remove the stack transition animation.

@satheeshwaran
Copy link

satheeshwaran commented May 13, 2023

Below is the options you can try:

(1) <WebView androidLayerType="software" ... />

* It would work but you will need to bear with the degraded performance instead.

* _Note_: Another thing you can try is to set **androidLayerType="hardware"**. It helps for some people.

(2) Disable react-native-screens for Platform.OS == 'android' and/or disable the animations of react-navigation in related screens with the WebView component.

(3) Try to prevent the crash

* **loading**: Move HTML content into a state variable and then call `setTimeout(this.setState({ html }), 1000)` later to assign that variable with the actual value.

* _Note_: This is to ensure that the animation would have already finished before the time when WebView comes in.

* **back+hardwareback**: Make sure to `setState({ html: undefined })` before navigating back (and starting the animation).

(4) Explore some alternatives, like react-native-render-html.

Settings androidLayerType="software" helped me solve an issue with expo, firebase, and expo-firebase-recaptcha on Android after a bunch of hair fell off my head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests