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

Android crash #405

Open
elan opened this issue Nov 13, 2020 · 35 comments
Open

Android crash #405

elan opened this issue Nov 13, 2020 · 35 comments

Comments

@elan
Copy link

elan commented Nov 13, 2020

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
@Kureev
Copy link
Owner

Kureev commented Nov 16, 2020

Hi @elan,

Can you provide more information on the topic? For example, a repro would be quite helpful

@elan
Copy link
Author

elan commented Nov 16, 2020

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.

@unValerio
Copy link

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

@mitesh-db
Copy link

Have anyone resolved it?

@mohity777
Copy link

i am facing too. It works for some seconds then crash

@mrousavy
Copy link

mrousavy commented Jan 27, 2021

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 Dimezis/BlurView#111 (comment)

EDIT 2: Maybe the library author might be able to help if someone creates a quick (non-react-native) repro for him (see Dimezis/BlurView#110 (comment))

@hackrx
Copy link

hackrx commented Jan 31, 2021

@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,

@bartzy
Copy link

bartzy commented Feb 27, 2021

@mrousavy @Kureev
Did you perhaps find a solution for this issue on Android?

@nhannah
Copy link

nhannah commented Mar 4, 2021

Look like a fix was made on the library: Dimezis/BlurView#110 (comment)

@C-odes
Copy link

C-odes commented Mar 11, 2021

@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 .

@RodolfoGS
Copy link

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)

@RodolfoGS
Copy link

Fix: #411

@zholmes1
Copy link

I am getting the NullPointerException as well. I'm only ever rendering one BlurView. It is positioned absolutely.

@jellyfish-tom
Copy link

we also are getting this error in our project. But still exists

@enestatli
Copy link

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",

@valeriashpiner
Copy link

@Kureev any ideas when 3.6.1 will be published on npm? Thank you!

@N3TC4T
Copy link

N3TC4T commented Oct 28, 2021

Fix: #411

This does not fix this issue, the crash is happens when the app is in background.

This probably fixes this issue:

#399

@sayurimizuguchi
Copy link

sayurimizuguchi commented Jan 7, 2022

Any timeline for when we're going to release/publish 3.6.1 to fix this issue?

@amrit220399
Copy link

amrit220399 commented Dec 5, 2022

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

@Harisene
Copy link

Harisene commented Dec 24, 2022

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)

@praisedavid787
Copy link

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

@RnbWd
Copy link

RnbWd commented Mar 13, 2023

Same I just started seeing this error after upgrading to the latest version

@Harisene
Copy link

Harisene commented Apr 3, 2023

When this will be resolved? I'm having v4.3.0 of the package. Still crashes rising up...

@Juan2662
Copy link

Same here. v4.3.0

@antseburova
Copy link

Same here. v4.2.0

@LouisKraemer
Copy link

Same here, latest 4.3.2. Any way I can help (provide logs, other informations)?

@dualism98
Copy link

Same here. v4.3.0

@antseburova
Copy link

antseburova commented Jul 18, 2023

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

@dualism98
Copy link

Cool, thanks! 🫶🏻
Hope it works

@sebas21
Copy link

sebas21 commented Aug 15, 2023

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

@dualism98
Copy link

Hey, @sebas21. You need use this package for patches - https://www.npmjs.com/package/patch-package

@dualism98
Copy link

@sebas21. It looks like he doesn't delete the methods, but changes the create View Instance method, adding a null check so that there is no crash

@elgambet
Copy link

Still having this problem, it only happens on prod for some devices, receive the following tracktrace on crashlytics:

java.util.Objects.requireNonNull (Objects.java:207)
com.reactnativecommunity.blurview.BlurViewManagerImpl.createViewInstance (BlurViewManagerImpl.java:22)
com.reactnativecommunity.blurview.BlurViewManager.createViewInstance (BlurViewManager.java:22)
com.reactnativecommunity.blurview.BlurViewManager.createViewInstance (BlurViewManager.java:12)
com.facebook.react.uimanager.ViewManager.createViewInstance (ViewManager.java:183)
com.facebook.react.uimanager.ViewManager.createView (ViewManager.java:115)
com.facebook.react.uimanager.NativeViewHierarchyManager.createView (NativeViewHierarchyManager.java:281)
com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute (UIViewOperationQueue.java:194)
com.facebook.react.uimanager.UIViewOperationQueue$1.run (UIViewOperationQueue.java:909)
com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches (UIViewOperationQueue.java:1026)
com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded (UIViewOperationQueue.java:984)
com.facebook.react.bridge.GuardedRunnable.run (GuardedRunnable.java:30)
android.os.Handler.handleCallback (Handler.java:984)
android.os.Handler.dispatchMessage (Handler.java:104)
android.os.Looper.loopOnce (Looper.java:238)
android.os.Looper.loop (Looper.java:357)
android.app.ActivityThread.main (ActivityThread.java:8088)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:548)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:957)

Using:

"@react-native-community/blur": "^4.4.0",
"react-native": "0.72.5",

@truongnguyen3
Copy link

Same as @elgambet, I have this problem too, only happens on prod for some devices.
here's the error in Appcenter Crashlytics

java.util.Objects.requireNonNull Objects.java:207
com.reactnativecommunity.blurview.BlurViewManagerImpl.createViewInstance BlurViewManagerImpl.java:22
com.reactnativecommunity.blurview.BlurViewManager.createViewInstance BlurViewManager.java:22
com.reactnativecommunity.blurview.BlurViewManager.createViewInstance BlurViewManager.java:12
com.facebook.react.uimanager.ViewManager.createViewInstance ViewManager.java:183
com.facebook.react.uimanager.ViewManager.createView ViewManager.java:115
com.facebook.react.uimanager.NativeViewHierarchyManager.createView NativeViewHierarchyManager.java:281
com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute UIViewOperationQueue.java:194
com.facebook.react.uimanager.UIViewOperationQueue$1.run UIViewOperationQueue.java:909
com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches UIViewOperationQueue.java:1026
com.facebook.react.uimanager.UIViewOperationQueue.access$2600 UIViewOperationQueue.java:47
com.facebook.react.uimanager.UIViewOperationQueue$2.runGuarded UIViewOperationQueue.java:984
com.facebook.react.bridge.GuardedRunnable.run GuardedRunnable.java:30
android.os.Handler.handleCallback Handler.java:942

Using:

"@react-native-community/blur": "^4.4.0",
"react-native": "0.72.15",

@Nader-CS
Copy link

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests