react-native-gzip
react-native-gzip copied to clipboard
'RNGzipSpec.h' file not found
'RNGzipSpec.h' file not found
This looks like a new architecture issue. Does anyone have a fix for this?
Same issue here - also running new arch
Same issue - any update on this?
It needs somebody to add support for new arch.
Quick fix is to re-enable old arch by adding ENV['RCT_NEW_ARCH_ENABLED'] = "0" to the first line of ios/Podfile and re-install pods (run pod install in ios folder).
I was trying to fix it, but without luck. Maybe others will help. I have created topic here: https://github.com/reactwg/react-native-new-architecture/discussions/262
Hi all, I thought about different idea. So I have removed the old code related to new arch. And it worked as expected on RN 076.x:
diff --git a/node_modules/react-native-gzip/ios/Gzip.h b/node_modules/react-native-gzip/ios/Gzip.h
index 45b39a3..1220ec5 100644
--- a/node_modules/react-native-gzip/ios/Gzip.h
+++ b/node_modules/react-native-gzip/ios/Gzip.h
@@ -1,12 +1,4 @@
-
-#ifdef RCT_NEW_ARCH_ENABLED
-#import "RNGzipSpec.h"
-
-@interface Gzip : NSObject <NativeGzipSpec>
-#else
#import <React/RCTBridgeModule.h>
@interface Gzip : NSObject <RCTBridgeModule>
-#endif
-
@end
diff --git a/node_modules/react-native-gzip/ios/Gzip.mm b/node_modules/react-native-gzip/ios/Gzip.mm
index b79ded4..24ae6e2 100644
--- a/node_modules/react-native-gzip/ios/Gzip.mm
+++ b/node_modules/react-native-gzip/ios/Gzip.mm
@@ -24,13 +24,4 @@ @implementation Gzip
resolve([[_data gzippedData] base64String]);
}
-// Don't compile this code when we build for the old architecture.
-#ifdef RCT_NEW_ARCH_ENABLED
-- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
- (const facebook::react::ObjCTurboModule::InitParams &)params
-{
- return std::make_shared<facebook::react::NativeGzipSpecJSI>(params);
-}
-#endif
-
@end
Hi all, I thought about different idea. So I have removed the old code related to new arch. And it worked as expected on RN 076.x:
diff --git a/node_modules/react-native-gzip/ios/Gzip.h b/node_modules/react-native-gzip/ios/Gzip.h index 45b39a3..1220ec5 100644 --- a/node_modules/react-native-gzip/ios/Gzip.h +++ b/node_modules/react-native-gzip/ios/Gzip.h @@ -1,12 +1,4 @@
-#ifdef RCT_NEW_ARCH_ENABLED -#import "RNGzipSpec.h"
-@interface Gzip : NSObject <NativeGzipSpec> -#else #import <React/RCTBridgeModule.h>
@interface Gzip : NSObject <RCTBridgeModule> -#endif
@end diff --git a/node_modules/react-native-gzip/ios/Gzip.mm b/node_modules/react-native-gzip/ios/Gzip.mm index b79ded4..24ae6e2 100644 --- a/node_modules/react-native-gzip/ios/Gzip.mm +++ b/node_modules/react-native-gzip/ios/Gzip.mm @@ -24,13 +24,4 @@ @implementation Gzip resolve([[_data gzippedData] base64String]); }
-// Don't compile this code when we build for the old architecture. -#ifdef RCT_NEW_ARCH_ENABLED -- (std::shared_ptrfacebook::react::TurboModule)getTurboModule:
- (const facebook::react::ObjCTurboModule::InitParams &)params -{
- return std::make_sharedfacebook::react::NativeGzipSpecJSI(params); -} -#endif
Thank you! I made a release if you don't want to patch like me
pnpm add react-native-gzip-new-architecture
or using npm
npm install react-native-gzip-new-architecture