react-native-blurhash icon indicating copy to clipboard operation
react-native-blurhash copied to clipboard

[BUG] Can't build iOS

Open wilkinsonj opened this issue 11 months ago • 4 comments

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:

  1. Add package to project
  2. Try to build using EAS build

Expected behavior I expect the build to succeed. Android build is successful.

wilkinsonj avatar Mar 09 '24 09:03 wilkinsonj

@janicduplessis, @mrousavy

Faced with same issue on bare React Native project

sektr63a avatar Mar 09 '24 12:03 sektr63a

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.

iM-GeeKy avatar Mar 12 '24 11:03 iM-GeeKy

Faced same issue

Saphirah avatar Apr 08 '24 09:04 Saphirah

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.

JimTeva avatar Apr 12 '24 03:04 JimTeva

Did anyone find a workaround that is not downgrading? For some reason, it works good on my machine but not on CI.

focux avatar May 23 '24 17:05 focux

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.

iM-GeeKy avatar May 23 '24 17:05 iM-GeeKy

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.

focux avatar May 23 '24 21:05 focux

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.

iM-GeeKy avatar May 23 '24 21:05 iM-GeeKy

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 avatar May 23 '24 22:05 focux

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

iM-GeeKy avatar May 23 '24 22:05 iM-GeeKy

Nice @focux

mrousavy avatar May 27 '24 09:05 mrousavy