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

'RNGzipSpec.h' file not found

Open ajiehatajie opened this issue 1 year ago • 7 comments

'RNGzipSpec.h' file not found

ajiehatajie avatar Aug 24 '24 06:08 ajiehatajie

This looks like a new architecture issue. Does anyone have a fix for this?

alexborton avatar Aug 29 '24 14:08 alexborton

Same issue here - also running new arch

jmazier-j2d avatar Sep 08 '24 20:09 jmazier-j2d

Same issue - any update on this?

PentamapRainer avatar Jan 08 '25 11:01 PentamapRainer

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

cixio avatar Jan 08 '25 15:01 cixio

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

lorenc-tomasz avatar Jan 30 '25 12:01 lorenc-tomasz

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

react-native-gzip+1.1.0.patch

lorenc-tomasz avatar Jan 30 '25 13:01 lorenc-tomasz

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

@end react-native-gzip+1.1.0.patch

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

LovesWorking avatar May 04 '25 18:05 LovesWorking