react-native-bootsplash icon indicating copy to clipboard operation
react-native-bootsplash copied to clipboard

Crash: Attempt to invoke direct method 'void android.view.SurfaceControl.checkNotReleased()'

Open kylecesmat opened this issue 1 year ago • 2 comments

Bug summary

This crash occurs when a Pixel user backgrounds the application before the splashscreen finishes & the hide method can be invoked.

Initially I filed a crash report w/ Google but their response suggests this can be avoided on v12 by perhaps trying to unregister setOnExitAnimationListener, as well as stop any other Splash screen animation/logic - possibly when the activity onPause is invoked?

Crash report: https://issuetracker.google.com/issues/242118185?pli=1

This is likely occurring near this line https://github.com/zoontek/react-native-bootsplash/blob/master/android/src/main/java/com/zoontek/rnbootsplash/RNBootSplashModule.java#L124

Library version

4.3.1

Environment info

SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 28, 29, 30, 31, 32
      Build Tools: 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0
      System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8309675
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.15 - /usr/bin/javac

Steps to reproduce

  1. Open an app with react-native-bootscreen
  2. Before the bootscreen completes, background the app
  3. Open the app back up and notice a crash

Reproducible sample code

Should be reproducible in sample app on a Google Pixel device.

kylecesmat avatar Aug 12 '22 16:08 kylecesmat

Also experiencing the same issue, we've had 31 crashes across 3 users

walterholohan avatar Sep 12 '22 11:09 walterholohan

Hi. The same here. https://issuetracker.google.com/issues/242118185

image

tr3v3r avatar Oct 06 '22 08:10 tr3v3r

Same image

I just removed this

setOnExitAnimationListener call entirely because I don't need fade out animation. Then, it seems to be fixed now.

mym0404 avatar Oct 17 '22 10:10 mym0404

I've experienced same issue. Is there any update the issue?

wakie92 avatar Feb 07 '23 01:02 wakie92

Same issue. Android 12 on Samsung SM-X800 device.

claudiozam avatar Apr 10 '23 12:04 claudiozam

Android 13 users facing this issue.

Screenshot 2023-04-28 at 12 42 02 PM

saadi-ninjasCode avatar Apr 28 '23 07:04 saadi-ninjasCode

We're facing the same issue on Android 13.

iferden avatar May 03 '23 13:05 iferden

We started seeing this crash as well after migrating from react-native-splash-screen to react-native-bootsplash:

Screenshot 2023-06-01 at 1 40 29 PM

techgerm avatar Jun 01 '23 20:06 techgerm

We are also seeing this crash. What is the fix for this?

roneyyb avatar Jun 02 '23 05:06 roneyyb

+1, same issue, i think issue is caused by android splash screen api: crash

devoren avatar Jun 04 '23 12:06 devoren

Same issue with 4.7.1

faisalamin9696 avatar Jun 12 '23 17:06 faisalamin9696

same +1

KolissnikBogdan avatar Jun 15 '23 13:06 KolissnikBogdan

same +1

Roamer77 avatar Jul 11 '23 08:07 Roamer77

Same

Soap-141 avatar Jul 27 '23 17:07 Soap-141

Same

a-petrenko-muse avatar Jul 28 '23 07:07 a-petrenko-muse

Could you please just upvote with emojis on the initial message instead of spamming?

No need to trigger notifications for everyone watching this thread just to say "Same".

zoontek avatar Jul 28 '23 07:07 zoontek

I investigated a bit, and can reproduce it.

The issue is kinda hard to solve since even if I implement a LifecycleEventListener, call activity.getSplashScreen().clearOnExitAnimationListener() on activity pause, it's already too late:

https://github.com/zoontek/react-native-bootsplash/assets/1902323/ec827aa6-84de-4541-8251-d091bb5ed202

The effect is what appears to be a restart of the UI, but it has no impact on the app itself.

zoontek avatar Jul 28 '23 21:07 zoontek

@zoontek since a complete fix might take you or the community longer to implement, can you recommend a workaround?

would you recommend this comment? even if it means that some feature will stop working, it might be better than an outright crash.

thanks!

LonelyCpp avatar Aug 08 '23 09:08 LonelyCpp

@LonelyCpp I would not recommend it, for a pretty good reason. The fix is here: https://github.com/zoontek/react-native-bootsplash/pull/475 😄

https://github.com/zoontek/react-native-bootsplash/assets/1902323/83db745e-8e47-4295-822e-933f99a4855e

zoontek avatar Aug 08 '23 13:08 zoontek

Version 5.0.0 is available: https://github.com/zoontek/react-native-bootsplash/releases/tag/5.0.0

zoontek avatar Aug 21 '23 22:08 zoontek

Facing the same issue in the 5.0 version also

Abhishek25031991 avatar Jan 02 '24 07:01 Abhishek25031991

Fix is OK for us in after upgraded to 5.4.0 from 4.X.X

Thanks @zoontek

gkueny avatar Mar 11 '24 07:03 gkueny