Closed wilkinsonj closed 6 months ago
@janicduplessis, @mrousavy
Faced with same issue on bare React Native project
Relates to https://github.com/mrousavy/react-native-blurhash/issues/186#issuecomment-1972097554. Reverting back to "react-native-blurhash": "~1.1.11"
, seems to resolve the issue for now.
Faced same issue
Same issue with bare rn project. (rn 0.72.6; podfile: use_frameworks! (because I use firebase)) As suggested by @iM-GeeKy I reverted back to rnblurhash 1.1.11 for the moment and it works again I cannot understand where the bug is coming from exactly.
Did anyone find a workaround that is not downgrading? For some reason, it works good on my machine but not on CI.
Did anyone find a workaround that is not downgrading? For some reason, it works good on my machine but not on CI.
I haven't been able to get anything above 1.1.11 to work. I thought it might work when new arch support was added in 2.0, but I prototyped upgrading my project to the new arch and it still didn't work. So long story short, unfortunately, I think the answer is no.
By the way, I found the cause of the bug, looks like it was related to using dynamic/static frameworks (use_frameworks
), which you most likely have enabled if you are using firebase.
I already opened a PR with the fix.
By the way, I found the cause of the bug, looks like it was related to using dynamic/static frameworks (
use_frameworks
), which you most likely have enabled if you are using firebase.I already opened a PR with the fix.
Nice work! I am in fact using firebase. I can try to use patch-package
to verify your PR.
Ya, that'd be great. It's working good for me. This is the patch:
diff --git a/node_modules/react-native-blurhash/ios/BlurhashModule.mm b/node_modules/react-native-blurhash/ios/BlurhashModule.mm
index 0069675..560040d 100644
--- a/node_modules/react-native-blurhash/ios/BlurhashModule.mm
+++ b/node_modules/react-native-blurhash/ios/BlurhashModule.mm
@@ -6,7 +6,12 @@
#import <blurhash_codegen/blurhash_codegen.h>
#endif
+#if __has_include("react_native_blurhash/react_native_blurhash-Swift.h")
+#import "react_native_blurhash/react_native_blurhash-Swift.h"
+#else
#import "react_native_blurhash-Swift.h"
+#endif
+
#ifdef RCT_NEW_ARCH_ENABLED
using namespace facebook::react;
@focux I built with the patch applied and it worked for me. Do note, I don't have the new arch enabled, I'm just running bridgeless mode with "react-native": "0.74.1",
, but previously without the patch this version was failing.
Nice @focux
For those who may run into this there is another file that needs to be changed like the patch above. The new patch is below
diff --git a/node_modules/react-native-blurhash/ios/BlurhashViewComponentView.mm b/node_modules/react-native-blurhash/ios/BlurhashViewComponentView.mm
index 2d919a9..e483bfb 100644
--- a/node_modules/react-native-blurhash/ios/BlurhashViewComponentView.mm
+++ b/node_modules/react-native-blurhash/ios/BlurhashViewComponentView.mm
@@ -10,7 +10,11 @@
#import <react/renderer/components/blurhash_codegen/Props.h>
#import <react/renderer/components/blurhash_codegen/RCTComponentViewHelpers.h>
+#if __has_include("react_native_blurhash/react_native_blurhash-Swift.h")
+#import "react_native_blurhash/react_native_blurhash-Swift.h"
+#else
#import "react_native_blurhash-Swift.h"
+#endif
using namespace facebook::react;
Bug
Get a Fastlane exception when creating a development build on EXPO - 'react_native_blurhash-Swift.h' file not found
To Reproduce Steps to reproduce the behavior:
Expected behavior I expect the build to succeed. Android build is successful.