mrousavy / react-native-blurhash

🖼️ A library to show colorful blurry placeholders while your content loads.
https://blurha.sh
MIT License
1.98k stars 70 forks source link

Fix use_frameworks! #191

Closed focux closed 6 months ago

focux commented 6 months ago

If a project uses dynamic frameworks on iOS, projects that include this library will not compile. This PR fixes that issue.

Fixes #188

iM-GeeKy commented 6 months ago

@mrousavy

mrousavy commented 6 months ago

Cool, thank you!

gjbadros commented 6 months ago

Hmmm, I recently switched to use_frameworks and even with using this latest release, our build (of Gluroo -- Hi Marc!) gives:

  (/Users/greg/gp/gluroo/app/node_modules/react-native-blurhash/ios/BlurhashViewComponentView.mm:13:9)

  11 | #import <react/renderer/components/blurhash_codegen/RCTComponentViewHelpers.h>
  12 |
> 13 | #import "react_native_blurhash-Swift.h"
     |         ^ 'react_native_blurhash-Swift.h' file not found
  14 |
  15 | using namespace facebook::react;
  16 |
focux commented 6 months ago

It doesn’t seems like the version that you are using has my change, according to your error message. On 28 May 2024 at 1:03 PM -0400, Greg Badros @.***>, wrote:

Hmmm, I recently switched to use_frameworks and even with using this latest release, our build (of Gluroo -- Hi Marc!) gives: (/Users/greg/gp/gluroo/app/node_modules/react-native-blurhash/ios/BlurhashViewComponentView.mm:13:9)

11 | #import <react/renderer/components/blurhash_codegen/RCTComponentViewHelpers.h> 12 |

13 | #import "react_native_blurhash-Swift.h" | ^ 'react_native_blurhash-Swift.h' file not found 14 | 15 | using namespace facebook::react; 16 | — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

gjbadros commented 6 months ago

I see the change in the BlurhashModule.mm file in my node_modules/react-native-blurhash/ installed package. But that header is nowhere in the directory. That file isn't getting generated by the build process for some reason. (I'm just trying the RN new architecture with Expo SDK 51 for the first time.)

gjbadros commented 6 months ago

Actually, I think it was upgrading to 2.x that broke my iOS build because Android build is broken too. Seems the same as https://github.com/mrousavy/react-native-blurhash/issues/190

iM-GeeKy commented 6 months ago

@gjbadros I was able to build successfully on both platforms on the latest version using Expo 51, but that was without enabling the new architecture via the flag.

mrousavy commented 6 months ago

hey greg!

hmmm, so new arch breaks after this?

gjbadros commented 6 months ago

Yes, that's true for our build. I can confirm that upgrading to 2.x broke both builds with the new architecture turned on (adding "newArchEnabled": true to app.json's expo.plugins[].expo-build-properties for both android and ios.

I've also just confirmed that I can upgrade to 2.x without the new architecture and Expo SDK 51 and have the build complete (haven't tested yet really).

elyobo commented 3 weeks ago

Seeing the same failure to build with v2 and the new arch and use_frameworks as mentioned above.