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

Recording currently in progress - missing #endRecording() call #1287

Closed
1 of 5 tasks
invyctus92 opened this issue Jan 26, 2022 · 26 comments · Fixed by #1406
Closed
1 of 5 tasks

Recording currently in progress - missing #endRecording() call #1287

invyctus92 opened this issue Jan 26, 2022 · 26 comments · Fixed by #1406
Labels
Missing info The user didn't precise the problem enough Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided

Comments

@invyctus92
Copy link

invyctus92 commented Jan 26, 2022

Recording currently in progress - missing #endRecording() call

Description

App crashes during navigation in Android

Steps To Reproduce

  1. in the home in my app with a tab menu and a drawer
  2. I open a page continuing in the stack of the first element of the tab
  3. I open another consecutive page in the stack
  4. when I quickly go back, pressing the back button twice, the app crashes

Screenshots

video.bug.mp4

Platform

  • iOS
  • Android
  • Web
  • Windows
  • tvOS

Log

java.lang.IllegalStateException: Recording currently in progress - missing #endRecording() call?
at android.graphics.RenderNode.beginRecording(RenderNode.java:372)
at android.view.View.updateDisplayListIfDirty(View.java:21199)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.swmansion.rnscreens.ScreenStack.performDraw(ScreenStack.kt:322)
at com.swmansion.rnscreens.ScreenStack.access$performDraw(ScreenStack.kt:15)
at com.swmansion.rnscreens.ScreenStack$DrawingOp.draw(ScreenStack.kt:343)
at com.swmansion.rnscreens.ScreenStack.drawAndRelease(ScreenStack.kt:296)
at com.swmansion.rnscreens.ScreenStack.dispatchDraw(ScreenStack.kt:313)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22353)
at android.view.View.draw(View.java:22223)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22353)
at android.view.View.draw(View.java:22223)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22353)
at android.view.View.draw(View.java:22223)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1277)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.swmansion.rnscreens.ScreenStack.performDraw(ScreenStack.kt:322)
at com.swmansion.rnscreens.ScreenStack.access$performDraw(ScreenStack.kt:15)
at com.swmansion.rnscreens.ScreenStack$DrawingOp.draw(ScreenStack.kt:343)
at com.swmansion.rnscreens.ScreenStack.drawAndRelease(ScreenStack.kt:296)
at com.swmansion.rnscreens.ScreenStack.dispatchDraw(ScreenStack.kt:313)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.ReactRootView.dispatchDraw(ReactRootView.java:225)
at android.view.View.draw(View.java:22221)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.draw(View.java:22353)
at eightbitlab.com.blurview.BlockingBlurController.updateBlur(BlockingBlurController.java:122)
at eightbitlab.com.blurview.BlockingBlurController.draw(BlockingBlurController.java:164)
at eightbitlab.com.blurview.BlurView.draw(BlurView.java:51)
at android.view.View.updateDisplayListIfDirty(View.java:21226)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22353)
at android.view.View.updateDisplayListIfDirty(View.java:21226)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22353)
at android.view.View.updateDisplayListIfDirty(View.java:21226)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1277)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.swmansion.rnscreens.ScreenStack.performDraw(ScreenStack.kt:322)
at com.swmansion.rnscreens.ScreenStack.access$performDraw(ScreenStack.kt:15)
at com.swmansion.rnscreens.ScreenStack$DrawingOp.draw(ScreenStack.kt:343)
at com.swmansion.rnscreens.ScreenStack.drawAndRelease(ScreenStack.kt:296)
at com.swmansion.rnscreens.ScreenStack.dispatchDraw(ScreenStack.kt:313)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
at android.view.View.draw(View.java:22353)
at android.view.View.updateDisplayListIfDirty(View.java:21226)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.View.draw(View.java:22081)
at android.view.ViewGroup.drawChild(ViewGroup.java:4516)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4277)
at android.view.View.updateDisplayListIfDirty(View.java:21217)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4500)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4473)
at android.view.View.updateDisplayListIfDirty(View.java:21186)

Package versions

package version
"react-native": "0.67.1",
"@react-navigation/bottom-tabs": "^6.0.9",
"@react-navigation/compat": "^5.3.20",
"@react-navigation/drawer": "^6.1.8",
"@react-navigation/native": "^6.0.6",
"@react-navigation/native-stack": "^6.2.5",
"@react-navigation/stack": "^6.0.11",
"react-native-gesture-handler": "2.2.0",
"react-native-screens": "^3.10.2",
"react-native-reanimated": "^2.3.1",
"react-native-safe-area-context": "^3.3.2",
@github-actions github-actions bot added Platform: Android This issue is specific to Android Missing repro This issue need minimum repro scenario Missing info The user didn't precise the problem enough labels Jan 26, 2022
@github-actions
Copy link

github-actions bot commented Jan 26, 2022

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Reproduction section.

@invyctus92
Copy link
Author

I found the reason why it happens, on the main page I have a blur effect on, and when I go back to this page which is the main page, the app crashes.

import { BlurView, VibrancyView } from "@react-native-community/blur";
<BlurView style={styles.absolute} blurType="light" viewRef={this.props.viewRef} blurAmount={1} />

@WoLewicki
Copy link
Member

Unfortunately, we cannot say much about this without a reproduction such as a snack or a simple repo.

@mjm918
Copy link

mjm918 commented Mar 13, 2022

This issue happens due to React Native Blur. Repo issue can be found here:
Kureev/react-native-blur#452

Most of the react-navigation 6 users are facing this issue. The crash log is same for everyone.

For me, the App will crash on android if it has blur view. I tried to mount the blur view after a delay but the crash still happens.

Example 1: In the navigator. Works fine on iOS but crashes on Android

<BottomTab.Navigator
screenOptions={{
	unmountOnBlur:true,
	tabBarStyle: { position: "absolute" },
	tabBarBackground: () => (
		// eslint-disable-next-line @typescript-eslint/ban-ts-comment
		// @ts-ignore
		<BlurView blurType={blurType} blurAmount={100} style={StyleSheet.absoluteFill} />
	)
}}

Example 2: In Main screen, the app crashes also

<ImageBackground
    source={C.ASSETS.DashboardScreen.menu}
    imageStyle={styles.menuImage}
    style={styles.menuImageContainer}>
    <BlurView style={styles.menuBlurView} blurType={theme_type} blurAmount={5}>
	    <RippleIconButton onPress={()=>Haptic(this.goProducts.bind(this))} rippleContainerBorderRadius={40} name={"cards"}>
		    PRODUCTS
	    </RippleIconButton>
	    <RippleIconButton onPress={()=>Haptic(this.onPressSearch.bind(this))} rippleContainerBorderRadius={40} name={"shopping-search"}>
		    SEARCH
	    </RippleIconButton>
	    <RippleIconButton rippleContainerBorderRadius={40} name={"vector-polyline-edit"}>
		    STATEMENTS
	    </RippleIconButton>
    </BlurView>
</ImageBackground>

I tried to remove the blur view from Navigator and used in the main screen only but the problem still persist

@github-actions github-actions bot added Repro provided A reproduction with a snack or repo is provided and removed Missing repro This issue need minimum repro scenario labels Mar 13, 2022
@WoLewicki
Copy link
Member

@mjm918 can you put the code in a form of a simple repo or a snack? We will be then able to easily reproduce the problem and collaborate.

@mjm918
Copy link

mjm918 commented Mar 22, 2022

Hi @WoLewicki sorry for late, I was a bit occupied. I have created a repo here

https://github.com/mjm918/RNScreensBlurViewCrash-Repro

Hope it will be helpful.

Thank you

@enlightenedpie
Copy link

enlightenedpie commented Mar 24, 2022

If you look at Kureev/react-native-blur Readme, there is a section:

Android uses the [BlurView](https://github.com/Dimezis/BlurView).

If you only need to support iOS, then you can safely ignore these limitations.

In addition to blurType and blurAmount, Android has some extra props that can be used to override the default behavior 
(or configure Android-specific behavior):

blurRadius (Number - between 0 and 25) - Manually adjust the blur radius. (Default: matches iOS blurAmount)
downsampleFactor (Number - between 0 and 25) - Scales down the image before blurring (Default: matches iOS 
blurAmount)
overlayColor (Color) - Set a custom overlay color (Default color based on iOS blurType)

So there's another library that's specifically tailored to Android for Blurview. It's less than ideal, but it's a solution.

@mjm918
Copy link

mjm918 commented Apr 1, 2022

@mjm918 can you put the code in a form of a simple repo or a snack? We will be then able to easily reproduce the problem and collaborate.

Hi @WoLewicki did you manage to check the issue?

@YounesKHENIFER
Copy link

same probleme , any solutions here..?

@mjm918
Copy link

mjm918 commented Apr 11, 2022

@YunsGeek no solution yet. stuck here for last 1 month. I'm using a transparent view on android instead of blurview. and my android app looks super ugly

@WoLewicki
Copy link
Member

I made a PR trying to solve this behavior with an explanation of what is happening under the hood: #1406. Could you check if it resolves the issue and does not introduce any new ones?

@WoLewicki WoLewicki linked a pull request Apr 13, 2022 that will close this issue
8 tasks
@mjm918
Copy link

mjm918 commented Apr 14, 2022

Thank you so much @WoLewicki . I tried your commit just now and the app crashed with the following exception:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: xxxxxxxxxx, PID: 9890
    java.lang.IndexOutOfBoundsException: Index: 1, Size: 0
        at java.util.ArrayList.get(ArrayList.java:437)
        at android.view.ViewGroup.getAndVerifyPreorderedView(ViewGroup.java:3765)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4287)
        at android.view.View.draw(View.java:22828)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
        at com.swmansion.rnscreens.ScreenStack.performDraw(ScreenStack.kt:308)
        at com.swmansion.rnscreens.ScreenStack.access$performDraw(ScreenStack.kt:14)
        at com.swmansion.rnscreens.ScreenStack$DrawingOp.draw(ScreenStack.kt:329)
        at com.swmansion.rnscreens.ScreenStack.drawAndRelease(ScreenStack.kt:283)
        at com.swmansion.rnscreens.ScreenStack.dispatchDraw(ScreenStack.kt:299)
        at android.view.View.draw(View.java:22828)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
        at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
        at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
        at android.view.View.draw(View.java:22828)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
        at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
        at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
        at android.view.View.draw(View.java:22828)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
        at com.facebook.react.views.view.ReactViewGroup.drawChild(ReactViewGroup.java:772)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
        at com.facebook.react.views.view.ReactViewGroup.dispatchDraw(ReactViewGroup.java:744)
        at android.view.View.draw(View.java:22828)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
        at com.facebook.react.ReactRootView.dispatchDraw(ReactRootView.java:226)
        at android.view.View.draw(View.java:22828)
        at android.view.ViewGroup.drawChild(ViewGroup.java:4528)
        at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4289)
        at android.view.View.draw(View.java:22960)
        at eightbitlab.com.blurview.BlockingBlurController.updateBlur(BlockingBlurController.java:149)
        at eightbitlab.com.blurview.BlockingBlurController$1.onPreDraw(BlockingBlurController.java:61)
        at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:1093)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3421)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2211)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8938)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1211)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1219)
        at android.view.Choreographer.doCallbacks(Choreographer.java:892)
        at android.view.Choreographer.doFrame(Choreographer.java:825)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1194)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7850)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

@WoLewicki
Copy link
Member

@mjm918 does this happen in the repo you provided? I couldn't spot such an issue there. Do you have an easy reproduction of this?

@WoLewicki
Copy link
Member

I was able to reproduce this issue with android:hardwareAccelerated="false" flag set in the project's manifest. At the same time, it crashes even without any code modifying the children drawing order in ScreenStack. Just above the crash, there is an information about BlurView needing the hardware acceleration. Are you sure it is present in your application. Could you double-check if this error does not appear in your logs too?
image

@mjm918
Copy link

mjm918 commented Apr 14, 2022

Hi @WoLewicki thank you for your fast response.

I think I found the root cause. The app will not crash if there is single blurview. I have updated the reproduction code here:

https://github.com/mjm918/RNScreensBlurViewCrash-Repro
Commit ID: 226a0a86e631cc0844f6fdd97df14c141aabb3d1
Screenshot 2022-04-14 at 9 10 36 PM

In the Code, I tried to create blurview with Array map and the app crashed.

@yincrash
Copy link

I made a PR trying to solve this behavior with an explanation of what is happening under the hood: #1406. Could you check if it resolves the issue and does not introduce any new ones?

This PR fixed the crash for me. I did not attempt with multiple blurviews though.

@WoLewicki
Copy link
Member

Does this changed code work in the simple case though @mjm918 ? I mean if you added it here: https://github.com/mjm918/RNScreensBlurViewCrash-Repro/blob/226a0a86e631cc0844f6fdd97df14c141aabb3d1/App.tsx. Cause it does not work for me due to probably recursive calls for updating blur from the BlurView, or am I missing something?
image

@mjm918
Copy link

mjm918 commented Apr 21, 2022

Does this changed code work in the simple case though @mjm918 ? I mean if you added it here: https://github.com/mjm918/RNScreensBlurViewCrash-Repro/blob/226a0a86e631cc0844f6fdd97df14c141aabb3d1/App.tsx. Cause it does not work for me due to probably recursive calls for updating blur from the BlurView, or am I missing something? image

Hi @WoLewicki in simple case like, 1 BlurView in 1 screen will work. But multiple blurview in a screen causes the crash

@WoLewicki
Copy link
Member

So, if there is a 1 BlurView, #1406 fixes the issue, and if there are multiple BlurViews, the app will crash anyway, doesn't matter if with react-native-screens or not. So I think we should merge #1406 and close this issue, since there is no more work to do on the side of the library. Or am I missing something?

@mjm918
Copy link

mjm918 commented Apr 24, 2022

So, if there is a 1 BlurView, #1406 fixes the issue, and if there are multiple BlurViews, the app will crash anyway, doesn't matter if with react-native-screens or not. So I think we should merge #1406 and close this issue, since there is no more work to do on the side of the library. Or am I missing something?

Sorry for late reply. I haven't tried the blurview without react-native-screens. that's why i cant really agree with this statement "doesn't matter if with react-native-screens or not".

What I found in some discussion is that people started experiencing this crash after upgrading react-navigation to v6.

@WoLewicki
Copy link
Member

What I found in some discussion is that people started experiencing this crash after upgrading react-navigation to v6.

I looks like an older issue: Kureev/react-native-blur#368.

I think we cannot do anything more in our library than what #1406 does. I will merge it and close this issue then. Feel free to comment here if I am missing something and we can always reopen it.

@LautaroNavarro
Copy link

@WoLewicki can we have a new release with the fix?

@WoLewicki
Copy link
Member

@LautaroNavarro sorry for late reply. We are planning on releasing new version when we end the Fabric integration of react-native-screens which should happen soon, so stay tuned 🎉

@vladimirevstratov
Copy link

vladimirevstratov commented Jul 6, 2022

thanks, after updating to latest react-native-screens problem has gone!

@fukemy
Copy link

fukemy commented Aug 19, 2022

still got this crash

@fxricky
Copy link

fxricky commented Oct 2, 2022

tried with:

"react-native-screens": "^3.17.0",
"@react-native-community/blur": "^4.2.0"

but the issue is still there.

My issue - Android crash when navigating to another screen that have react-native-blur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing info The user didn't precise the problem enough Platform: Android This issue is specific to Android Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants