-
Notifications
You must be signed in to change notification settings - Fork 558
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
Just hard-crashes on Android without any error info #368
Comments
Update: the app only crashes in my case, because I render multiple This makes the library unusable! Also, on Android I noticed the |
We are experiencing the same issue. @mrousavy Have you found a way around this? |
@kamiranoff Unfortunately not. I've experienced so many bugs on android, sometimes the blur view glitches out so when I navigate to other screens, there still is a low-opacity overlay on the screen making everything look like it's a street sign in nevada which has been exposed to direct sunlight since 1950. The hard crash just occured when I used my blur view in a List (1 blur view per list item) which works fine on iOS. Keep me updated if you find a solution to this! |
@mrousavy ahah. That is concerning. Will do. Thanks! |
Also getting some crash on Android, using with a FlatList on each item. Works just fine on iOS Getting these error :
|
Somewhere in the source code I read the Android version of |
Also experiencing this crash, with a |
Came across the same issue when using the BlurView inside a |
after RN update to |
Doesn't seem to help my case unfortunately - I don't know but for me it seems this entire lib is highly unusable I made a state var and added it to the component state var starts as 0 then on button press I use setBlur(10)
|
@Dinkelborg using the term "page" you suggest that you're using it on react project, not react native ? |
No its a react native project but we do have different pages that you can navigate through if it feels more comfortable to you I can also call them screens or views |
@Dinkelborg yeah, the word "page" can be misleading in this case. But going back to your issue, this is how i use blur view in my project, maybe it can help // @flow
import React, {useEffect, useState} from 'react';
import {View, Animated, Platform, findNodeHandle} from 'react-native';
import ScreenWrapper from '../ScreenWrapper';
import BackArrow from '../BackArrow';
import style from './style';
import Spinner from '../Spinner';
import {COLOR_PRIMARY} from '../../config/style';
import {BlurView} from '@react-native-community/blur';
type Props = {};
const HeaderScreenWrapper = (props: Props) => {
let wrapperRef = null;
const [viewRef: any, setRef] = useState(null);
const [isBlurVisible: boolean, setBlurVisible] = useState(false);
useEffect(() => {
setBlurVisible(props.blur);
}, [props.blur]);
function _renderBlur() {
if (isBlurVisible) {
return (
<BlurView
style={style.absolute}
viewRef={viewRef}
blurType="dark"
blurAmount={3}
/>
);
}
}
return (
<ScreenWrapper>
{_renderBlur()}
<View
style={[style.container, props.containerStyle]}
ref={el => (wrapperRef = el)}
onLayout={() => setRef(findNodeHandle(wrapperRef))}>
<Animated.View style={[style.content, props.contentStyle]}>
{props.children}
</Animated.View>
</View>
</ScreenWrapper>
);
};
export default HeaderScreenWrapper; |
Yeah thanks but that doesn't really help me I know I can just hide and show the blur view (or not render it in your case) |
@Dinkelborg on which platform are you experiencing the crashes? I've been having no issues with blur animations on iOS. Could you please run your app in debug mode in Xcode (iOS) or Android Studio (Android) and tell us what the error/exception exactly is and where it occurs? |
Hey, with me when I downloaded the 3.3.1 version and try to run the app with "yarn android" I get the following error: |
I have the same problem, did you managed to fix this? |
|
@Ceredavide I followed the suggestions in the link you posted.
The Android app still crashes as described in all the other reported issues. If you or anyone else has any suggestions on how to resolve this or maybe a step I missed it would be greatly appreciated. |
@nandorojo I'll talk with the team |
I Found the solution it is happening due to you are using: BlurView inside BlurView so that why change the inner BlurView with normal View then this will work but in the case of IOS, it is working fine with this solution now it is working on both paltform |
You can remove that overlay by using property. |
It specifically crashes on android when nested in a import React, { memo, useEffect, useState } from 'react';
import { Platform } from 'react-native';
import { BlurView, BlurViewProperties } from '@react-native-community/blur';
/**
* This is a workaround for the fact that BlurView doesn't work on Android when nested in a Flatlist.
*
* Drop in replacement for BlurView.
*
* @see {@link [GitHub Issue](https://github.com/Kureev/react-native-blur/issues/368)}
*/
const StableBlurView: React.FC<BlurViewProperties> = memo(props => {
const [shouldRenderBlur, setShouldRenderBlur] = useState(Platform.OS === 'android' ? false : true);
useEffect(() => {
setTimeout(() => setShouldRenderBlur(true), 0);
}, []);
if (!shouldRenderBlur) return null;
return <BlurView {...props} />;
});
export default StableBlurView; |
hey @mrousavy any update on this, even i wanna use blurview in flatlist.. |
@Nagasai97 @mrousavy This worked for me!! I was trying to implement multiple blur views i.e Background & inside Flat list. This was working fine until I also added a BottomTabs Navigation bar. After which the android app started to crash as I scrolled through.... [Seriously very frustrating] The solution posted in this Git Issue solved my problem: Here You just have to add the below implementation to the '/android/app/build.gradle' file.
|
Blur Affect doesnt not show up in android after doing this. |
same issue here. |
Try this, For me its working export const BlurView: React.FC<BlurViewProperties & { navigation: NavigationProp }> = memo(props => {
}); |
I am Facing same issue. Please update if this issue is fixed |
@ahetesum Did you try the solution I shared above? |
Bug
The library just hard crashes on android without any error or description. Nothing is being logged in the metro server console. On iOS it works fine.
For debugging reasons, I used the exact same code shown in the
README.md
example of this library:I have also tried manually linking the library and adding the package to the
AndroidManifest.xml
following the README.Environment info
react-native info
output:Library version: 3.6.0
Steps To Reproduce
Reproducible sample code
The text was updated successfully, but these errors were encountered: