react-native-blur
react-native-blur copied to clipboard
Android crash
We see a fair number of these show up in our bug reporting system:
java.lang.NullPointerException
Objects.java:220java.util.Objects.requireNonNull
BlurViewManager.java:35com.cmcewen.blurview.BlurViewManager.createViewInstance
BlurViewManager.java:20com.cmcewen.blurview.BlurViewManager.createViewInstance
ViewManager.java:47com.facebook.react.uimanager.ViewManager.createView
NativeViewHierarchyManager.java:256com.facebook.react.uimanager.NativeViewHierarchyManager.createView
UIViewOperationQueue.java:200com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute
UIViewOperationQueue.java:911com.facebook.react.uimanager.UIViewOperationQueue$1.run
UIViewOperationQueue.java:1025com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches
UIViewOperationQueue.java:46com.facebook.react.uimanager.UIViewOperationQueue.access$2600
UIViewOperationQueue.java:983com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded
GuardedRunnable.java:24com.facebook.react.bridge.GuardedRunnable.run
Hi @elan,
Can you provide more information on the topic? For example, a repro would be quite helpful
Unfortunately I don't have a specific one, except that I've only seen it at launch. Would seem to be a race of some kind.
My app is also crashing in some parts or slowing down when using BlurView on Android when setting the position style to absolute.
I have a HOC for a loader when saving changes on my app, the blur is showed up on the entire screen, most of the times it works well but I have two specific pages in which the blur causes problems, either slowing down the app or crashing it
Have anyone resolved it?
i am facing too. It works for some seconds then crash
This is a pretty common issue. Apparently Android limits the number of BlurViews per activity to 1, this is a limitation of the eightbitlab.com.blurview.BlurView library.
So if you have multiple <BlurView />
views per screen, your app will crash on Android.
My advice, don't render BlurViews for Android, limit it to an iOS only feature. See the current list of Android issues
EDIT: Is this react-native library re-using the RenderScriptBlur
object? See https://github.com/Dimezis/BlurView/issues/111#issuecomment-582119313
EDIT 2: Maybe the library author might be able to help if someone creates a quick (non-react-native) repro for him (see https://github.com/Dimezis/BlurView/issues/110#issuecomment-764922464)
@mrousavy you are right, I am rendering a list of images in Flatlist and using BlurView
for each image, and then the app is simply crashing, I think it is only supporting a single blur/screen,
@mrousavy @Kureev Did you perhaps find a solution for this issue on Android?
Look like a fix was made on the library: https://github.com/Dimezis/BlurView/issues/110#issuecomment-786939860
@mrousavy you are right, I am rendering a list of images in Flatlist and using
BlurView
for each image, and then the app is simply crashing, I think it is only supporting a single blur/screen,
Images have a property called blurRadius that you can use. This library is needed to get Views to be blurred so maybe you dont need it .
I've the same issue @react-native-community/blur: 3.6.0
Someone could fix it? Thanks
java.lang.NullPointerException: null
at java.util.Objects.requireNonNull(Objects.java:203)
at com.cmcewen.blurview.BlurViewManager.createViewInstance(BlurViewManager.java:35)
at com.cmcewen.blurview.BlurViewManager.createViewInstance(BlurViewManager.java:20)
at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139)
at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:83)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:261)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:186)
at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:911)
at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1028)
at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:48)
at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded(UIViewOperationQueue.java:986)
at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:31)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6788)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
Fix: https://github.com/Kureev/react-native-blur/pull/411
I am getting the NullPointerException as well. I'm only ever rendering one BlurView. It is positioned absolutely.
we also are getting this error in our project. But still exists
it is solved by with the version 3.6.1
but not published on npm, add following to your package.json:
"@react-native-community/blur": "https://github.com/Kureev/react-native-blur/archive/refs/tags/v3.6.1.tar.gz",
@Kureev any ideas when 3.6.1 will be published on npm? Thank you!
Fix: #411
This does not fix this issue, the crash is happens when the app is in background.
This probably fixes this issue:
https://github.com/Kureev/react-native-blur/pull/399
Any timeline for when we're going to release/publish 3.6.1 to fix this issue?
We see a fair number of these show up in our bug reporting system:
java.lang.NullPointerException Objects.java:220java.util.Objects.requireNonNull BlurViewManager.java:35com.cmcewen.blurview.BlurViewManager.createViewInstance BlurViewManager.java:20com.cmcewen.blurview.BlurViewManager.createViewInstance ViewManager.java:47com.facebook.react.uimanager.ViewManager.createView NativeViewHierarchyManager.java:256com.facebook.react.uimanager.NativeViewHierarchyManager.createView UIViewOperationQueue.java:200com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute UIViewOperationQueue.java:911com.facebook.react.uimanager.UIViewOperationQueue$1.run UIViewOperationQueue.java:1025com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches UIViewOperationQueue.java:46com.facebook.react.uimanager.UIViewOperationQueue.access$2600 UIViewOperationQueue.java:983com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded GuardedRunnable.java:24com.facebook.react.bridge.GuardedRunnable.run
Facing Same Issue on Android 11
yep. Crashing on Android 11 for me too...
Fatal Exception: java.lang.NullPointerException: at java.util.Objects.requireNonNull(Objects.java:220) at com.reactnativecommunity.blurview.BlurViewManagerImpl.createViewInstance(BlurViewManagerImpl.java:27) at com.reactnativecommunity.blurview.BlurViewManager.createViewInstance(BlurViewManager.java:22) at com.reactnativecommunity.blurview.BlurViewManager.createViewInstance(BlurViewManager.java:12) at com.facebook.react.uimanager.ViewManager.createViewInstance(ViewManager.java:139) at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:83) at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:281) at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:188) at com.facebook.react.uimanager.UIViewOperationQueue$1.run(UIViewOperationQueue.java:902) at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:1019) at com.facebook.react.uimanager.UIViewOperationQueue.access$2600(UIViewOperationQueue.java:47) at com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded(UIViewOperationQueue.java:977) at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:31) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:246) at android.app.ActivityThread.main(ActivityThread.java:8653) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Hi guys, this just came up on my crashlytics too. Anything close to a solution in the works?
Exception java.lang.NullPointerException: at java.util.Objects.requireNonNull (Objects.java:220) at com.reactnativecommunity.blurview.BlurViewManagerImpl.createViewInstance
Same I just started seeing this error after upgrading to the latest version
When this will be resolved? I'm having v4.3.0 of the package. Still crashes rising up...
Same here. v4.3.0
Same here. v4.2.0
Same here, latest 4.3.2. Any way I can help (provide logs, other informations)?
Same here. v4.3.0
I created a patch for v4.3.2 based on this PR and it worked like magic. We have applied the patch almost a month ago, and no issues reported since then.
Here is my patch file: @react-native-community+blur+4.3.2.patch
Cool, thanks! 🫶🏻 Hope it works
I created a patch for v4.3.2 based on this PR and it worked like magic. We have applied the patch almost a month ago, and no issues reported since then.
Here is my patch file: @react-native-community+blur+4.3.2.patch
@antseburova @dualism98 Can you explain to me how I can make the patch? plz