You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Thanks for this awesome lib! Today I found a weird crash report coming from bootsplash. It has only been reported by a specific device so far, here are the details:
💻 My environment
react-native-bootsplash version: 1.2.1
react-native version: 0.61.5
Platform: Android
OS version: 5.0
Device: Samsung Galaxy Note 3
Android buildToolsVersion: ?
🕵️♂️ Reproducing the issue
I'm not sure how, but I think it's kinda my fault but perhaps it should also be addressed by this library if it hasn't already. I got two places where I call the method to hide the bootsplash:
// ... somewhere in my boot "sequence"useEffect(()=>{// If for some reason we take more than 2 seconds to boot// this hides bootsplash and shows a spinnersetTimeout(()=>RNBootSplash.hide(200),2000);},[]);useEffect(()=>{// Wait until we're ready to show the splashscreenif(platformReady){RNBootSplash.hide(200);}},[platformReady]);
I'm guessing that the second call to RNBootSplash.hide could fail in this particular config because the View no longer exists and bootsplash doesn't handle that case? I wasn't handling that particular case because... well, I assumed it would just do nothing 😅
This problem doesn't seem to affect any other device yet, but I'll keep an eye on it.
Stacktrace
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference
at com.zoontek.rnbootsplash.RNBootSplashModule$1$1.onAnimationEnd(RNBootSplashModule.java)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1116)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1089)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:666)
at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:682)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:559)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
🤞Solution
I'm not sure. Perhaps checking if the reference is not null before calling removeView? I'll try to add a check on the React side to avoid calling RNBootSplash.hide twice and see if this fixes the issue for me.
I'm not an Android dev, so I haven't checked the code to see if perhaps that's exactly what happened here.
The text was updated successfully, but these errors were encountered:
Hi! Thanks for this awesome lib! Today I found a weird crash report coming from bootsplash. It has only been reported by a specific device so far, here are the details:
💻 My environment
🕵️♂️ Reproducing the issue
I'm not sure how, but I think it's kinda my fault but perhaps it should also be addressed by this library if it hasn't already. I got two places where I call the method to hide the bootsplash:
I'm guessing that the second call to
RNBootSplash.hide
could fail in this particular config because theView
no longer exists and bootsplash doesn't handle that case? I wasn't handling that particular case because... well, I assumed it would just do nothing 😅This problem doesn't seem to affect any other device yet, but I'll keep an eye on it.
Stacktrace
🤞Solution
I'm not sure. Perhaps checking if the reference is not null before calling
removeView
? I'll try to add a check on the React side to avoid callingRNBootSplash.hide
twice and see if this fixes the issue for me.I'm not an Android dev, so I haven't checked the code to see if perhaps that's exactly what happened here.
The text was updated successfully, but these errors were encountered: