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

Fix multiple blur view issues #411

Merged
merged 1 commit into from
Apr 26, 2021
Merged

Fix multiple blur view issues #411

merged 1 commit into from
Apr 26, 2021

Conversation

ja-ka
Copy link
Contributor

@ja-ka ja-ka commented Feb 27, 2021

Dimezis just released a fix with Dimezis/BlurView#110 to address app crashes on Android when multiple blur views are in place. This PR includes the most recent version from https://github.com/Dimezis/BlurView into this project.

@flyingSAP
Copy link
Contributor

Hi @Kureev can this be merged?

@zmtmaster
Copy link

zmtmaster commented Mar 3, 2021

Issue seems to be using two BlurView components, This PR uses the lasted update from https://github.com/Dimezis/BlurView which solves the issue,

See Dimezis/BlurView#110 (comment)

Used this fix with patch-package it does work, so until this will be merged here's patch file if anyone need it.

diff --git a/node_modules/@react-native-community/blur/android/build.gradle b/node_modules/@react-native-community/blur/android/build.gradle
index 8177235..b401cb8 100644
--- a/node_modules/@react-native-community/blur/android/build.gradle
+++ b/node_modules/@react-native-community/blur/android/build.gradle
@@ -43,5 +43,5 @@ repositories {
 dependencies {
     //noinspection GradleDynamicVersion
     implementation 'com.facebook.react:react-native:+'
-    implementation 'com.eightbitlab:blurview:1.6.3'
+    implementation 'com.eightbitlab:blurview:1.6.6'
 }

@tsdmrfth
Copy link

tsdmrfth commented Mar 3, 2021

@zmtmaster Thanks for the patch. It works!

@nhannah
Copy link

nhannah commented Mar 4, 2021

Thanks for putting up the PR hopefully they merge it soon!

@lakhvirk
Copy link

lakhvirk commented Mar 6, 2021

Please merge it soon as this issue ruins my whole week to figure out where is the issue 😢
I finished my project by testing app on iOS and it was working fine but when I tested on android, i saw my app getting freezes 🥶 and slow..
It took me so long to figure out this..
Please save someone’s life like me 👍 who might be struggling somewhere else 😃

@coding-st
Copy link

@zmtmaster thanks for the fix. Can you give a little more detailed description how to perform the fix with patch-package. I never used patch-package before & don't know what to do exactly.

Big thanks in advance.

@zmtmaster
Copy link

@zmtmaster thanks for the fix. Can you give a little more detailed description how to perform the fix with patch-package. I never used patch-package before & don't know what to do exactly.

Big thanks in advance.

patch-package is a NPM module that allows you to change a node_module files (ie dependents, source files, type file etc') and by creating a diff file (patch file) it can keep the changes made for the whole team to be sync, it is great for use cases like this bug we are facing that we need to keep the module working but we can not wait for the PR to be merged.

you can read more about it here https://www.npmjs.com/package/patch-package

@C-odes
Copy link

C-odes commented Mar 11, 2021

Issue seems to be using two BlurView components, This PR uses the lasted update from https://github.com/Dimezis/BlurView which solves the issue,

See Dimezis/BlurView#110 (comment)

Used this fix with patch-package it does work, so until this will be merged here's patch file if anyone need it.

diff --git a/node_modules/@react-native-community/blur/android/build.gradle b/node_modules/@react-native-community/blur/android/build.gradle
index 8177235..b401cb8 100644
--- a/node_modules/@react-native-community/blur/android/build.gradle
+++ b/node_modules/@react-native-community/blur/android/build.gradle
@@ -43,5 +43,5 @@ repositories {
 dependencies {
     //noinspection GradleDynamicVersion
     implementation 'com.facebook.react:react-native:+'
-    implementation 'com.eightbitlab:blurview:1.6.3'
+    implementation 'com.eightbitlab:blurview:1.6.6'
 }

So I'm new to react native.. how do I add this as it's not merged yet? I understand you use patch-package but if you could give more pointers on what steps are needed.

Do I just add a file with that content and run patch-package command withotu arguments? If so where do I add the file?

Watched a tutorial and found out I believe. Placed the edit in and gona test it. Should it work I'll make it with patch-package so the change doesnt get whiped out until the merge comes.

@kevinvangelder
Copy link

@C-odes You put that snippet into a file at patches/@react-native-community+blur+3.6.0.patch and then, if you have patch-package correctly configured it will apply the patch after every yarn/npm install.

@RodolfoGS RodolfoGS mentioned this pull request Mar 30, 2021
@C-odes
Copy link

C-odes commented Mar 30, 2021

@C-odes You put that snippet into a file at patches/@react-native-community+blur+3.6.0.patch and then, if you have patch-package correctly configured it will apply the patch after every yarn/npm install.

Applied the fix and patch-package. IT seemed to work but when I deleted node modules and ran yarn install. It didnt apply the patch... odd.

IS there more than just applying the change, run patch-package to create the "patches" folder with the changes in it?

@RodolfoGS
Copy link

@C-odes You put that snippet into a file at patches/@react-native-community+blur+3.6.0.patch and then, if you have patch-package correctly configured it will apply the patch after every yarn/npm install.

Applied the fix and patch-package. IT seemed to work but when I deleted node modules and ran yarn install. It didnt apply the patch... odd.

IS there more than just applying the change, run patch-package to create the "patches" folder with the changes in it?

You need to add "postinstall": "patch-package" to your package.json and install with npm i patch-package
Follow the setup: https://github.com/ds300/patch-package#set-up

@seancheung
Copy link

seancheung commented Apr 13, 2021

Issue seems to be using two BlurView components, This PR uses the lasted update from https://github.com/Dimezis/BlurView which solves the issue,

See Dimezis/BlurView#110 (comment)

Used this fix with patch-package it does work, so until this will be merged here's patch file if anyone need it.

diff --git a/node_modules/@react-native-community/blur/android/build.gradle b/node_modules/@react-native-community/blur/android/build.gradle
index 8177235..b401cb8 100644
--- a/node_modules/@react-native-community/blur/android/build.gradle
+++ b/node_modules/@react-native-community/blur/android/build.gradle
@@ -43,5 +43,5 @@ repositories {
 dependencies {
     //noinspection GradleDynamicVersion
     implementation 'com.facebook.react:react-native:+'
-    implementation 'com.eightbitlab:blurview:1.6.3'
+    implementation 'com.eightbitlab:blurview:1.6.6'
 }

You don't need to do that. Just force the dependency version in your android/app/build.gradle:

dependencies {
    implementation('com.eightbitlab:blurview:1.6.6') {
        force = true
    }
}

Copy link

@bouteillerAlan bouteillerAlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

work for me too

need this mr asap, this is annoying behavior while this package is useful ^^

@Kureev Kureev merged commit 70c7d2c into Kureev:master Apr 26, 2021
@Kureev
Copy link
Owner

Kureev commented Apr 26, 2021

Hi folks! Thanks for submitting a pull request, but this library is no longer maintained. Please, consider using a community fork: @react-native-community/blur

@sonicdoe
Copy link
Contributor

Isn’t this @react-native-community/blur? The package.json contains @react-native-community/blur and react-native-community/react-native-blur redirects to this repository.

@C-odes
Copy link

C-odes commented Apr 28, 2021

Isn’t this @react-native-community/blur? The package.json contains @react-native-community/blur and react-native-community/react-native-blur redirects to this repository.

Yes? It is @react-native-community/blur

@jaquinocode
Copy link

jaquinocode commented Jul 12, 2021

Isn’t this @react-native-community/blur? The package.json contains @react-native-community/blur and react-native-community/react-native-blur redirects to this repository.

@Kureev Can you respond to this? Why are you the owner of a community repo but you say you're not? It's concerning. Some clarity would be great, thanks. 🙂

For reference, this is what you said:

Hi folks! Thanks for submitting a pull request, but this library is no longer maintained. Please, consider using a community fork: @react-native-community/blur

@thiago-sants
Copy link

thiago-sants commented Jul 13, 2021

I'm having this problem too. Seems like it won't be fixed any time soon. And I didn't find other options. If anyone has an alternative, I would be really grateful.

Edit: I found a way to resolve this: disable React Navigation animation on screens that uses BlurView. It's the only way that I found to resolve this problem without excluding BlurView from the app. I got this solution from this comment.

@chenop
Copy link

chenop commented Aug 23, 2021

Issue seems to be using two BlurView components, This PR uses the lasted update from https://github.com/Dimezis/BlurView which solves the issue,
See Dimezis/BlurView#110 (comment)
Used this fix with patch-package it does work, so until this will be merged here's patch file if anyone need it.

diff --git a/node_modules/@react-native-community/blur/android/build.gradle b/node_modules/@react-native-community/blur/android/build.gradle
index 8177235..b401cb8 100644
--- a/node_modules/@react-native-community/blur/android/build.gradle
+++ b/node_modules/@react-native-community/blur/android/build.gradle
@@ -43,5 +43,5 @@ repositories {
 dependencies {
     //noinspection GradleDynamicVersion
     implementation 'com.facebook.react:react-native:+'
-    implementation 'com.eightbitlab:blurview:1.6.3'
+    implementation 'com.eightbitlab:blurview:1.6.6'
 }

You don't need to do that. Just force the dependency version in your android/app/build.gradle:

dependencies {
    implementation('com.eightbitlab:blurview:1.6.6') {
        force = true
    }
}

Adding

implementation('com.eightbitlab:blurview:1.6.6') {
         force = true
}

Worked for me - @seancheung can you please explain why is it fixing the issue?

@chenop
Copy link

chenop commented Aug 23, 2021

Another way to resolve that is using the latest tagged version "3.6.1":
"@react-native-community/blur": "https://github.com/Kureev/react-native-blur#3.6.1",

Its include:

implementation('com.eightbitlab:blurview:1.6.6') {
         force = true
}

Its a shame it was not released...

@Lexical-Luke
Copy link

@chenop how exactly do I apply that?

When I add that to my package.json and npm install I get the error "error: pathspec '3.6.1' did not match any file(s) known to git", I really need this fix as of course, this issue is still present.

@chenop
Copy link

chenop commented Aug 24, 2021

@Lexical-Luke nothing special - like you wrote

  • Add to package.json:
    "@react-native-community/blur": "https://github.com/Kureev/react-native-blur#3.6.1",
  • npm install

@alexanderblackh
Copy link

Anyone know how to fix this with iOS? Running 3.6.0, yarn says there is no 3.6.1.

@sayurimizuguchi
Copy link

Any timeline when we're going to release/publish 3.6.1?

@mjm918
Copy link

mjm918 commented Apr 30, 2022

this issue still happening in 3.6.1

@premhowli-buyhatke
Copy link

premhowli-buyhatke commented Jun 12, 2023

I am using version 4.3.2 and still see the same issue. do I need to patch com.eightbitlab:blurview:1.6.6 or is there any new version available? also where is this hosted. build system could not find this in google as well as mavencentral.

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

Successfully merging this pull request may close these issues.