-
Notifications
You must be signed in to change notification settings - Fork 126
Patch for builing issues in RN 0.78 #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
if you are working with RCT_NEW_ARCH_ENABLED = true just remove this lines from : "node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm"
|
Thanks! |
+1 |
In my case, this patch didn't solve my problem; I kept getting the same error. I ended up having to update the podspec and iOS files differently to fix the problem. This patch is working for me:
|
@ahc2806 patch didn't work but base on his patch "react-native-exit-app": "^2.0.0", diff --git a/node_modules/react-native-exit-app/RNExitApp.podspec b/node_modules/react-native-exit-app/RNExitApp.podspec
index 7290b50..f40520a 100644
--- a/node_modules/react-native-exit-app/RNExitApp.podspec
+++ b/node_modules/react-native-exit-app/RNExitApp.podspec
@@ -1,6 +1,6 @@
require 'json'
-packageJson = JSON.parse(File.read('package.json'))
+packageJson = JSON.parse(File.read(File.join(__dir__, "package.json")))
version = packageJson["version"]
description = packageJson["description"]
homepage = packageJson["homepage"]
@@ -17,27 +17,15 @@ Pod::Spec.new do |s|
s.summary = "Exit,close,kill,shutdown app completely for React Native"
s.license = license
s.authors = author
+ s.platforms = { :ios => "12.4", :tvos => "12.4" }
+ s.requires_arc = true
+
s.source = { :git => repository, :tag => version }
- s.platforms = { :ios => "9.0", :tvos => "11.0" }
- s.preserve_paths = 'README.md', 'package.json', '*.js'
s.source_files = 'ios/RNExitApp/**/*.{h,m,mm}'
- s.dependency 'React-Core'
-
- # Don't install the dependencies when we run `pod install` in the old architecture.
- if ENV["RCT_NEW_ARCH_ENABLED"] == "1"
- s.compiler_flags = folly_flags + " -DRCT_NEW_ARCH_ENABLED=1"
- s.pod_target_xcconfig = {
- "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
- "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
- "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
- }
-
- s.dependency "React-Codegen"
- s.dependency "React-RCTFabric"
- s.dependency "RCT-Folly"
- s.dependency "RCTRequired"
- s.dependency "RCTTypeSafety"
- s.dependency "ReactCommon/turbomodule/core"
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
+ install_modules_dependencies(s)
+ else
+ s.dependency "React-Core"
end
end
diff --git a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
index 50a2135..e669051 100644
--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
@@ -1,19 +1,9 @@
-#if __has_include(<React/RCTBridgeModule.h>)
-#import <React/RCTBridgeModule.h>
-#elif __has_include("RCTBridgeModule.h")
-#import "RCTBridgeModule.h"
+#ifdef RCT_NEW_ARCH_ENABLED
+#import <RNExitAppSpec/RNExitAppSpec.h>
+@interface RNExitApp : NSObject <NativeRNExitAppSpec>
#else
-#import "React/RCTBridgeModule.h"
-#endif
-
-#if RCT_NEW_ARCH_ENABLED
-#import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>
-#endif
-
+#import <React/RCTBridgeModule.h>
@interface RNExitApp : NSObject <RCTBridgeModule>
-@end
+#endif
-#if RCT_NEW_ARCH_ENABLED
-@interface RNExitApp () <NativeRNExitAppSpec>
@end
-#endif
diff --git a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
index bec5948..1cdb55b 100644
--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
@@ -2,7 +2,7 @@
#import "RNExitApp.h"
-#if RCT_NEW_ARCH_ENABLED
+#ifdef RCT_NEW_ARCH_ENABLED
#import <RNExitAppSpec/RNExitAppSpec.h>
#endif
@@ -17,11 +17,9 @@ RCT_EXPORT_METHOD(exitApp)
# pragma mark - New Architecture
-#if RCT_NEW_ARCH_ENABLED
+#ifdef RCT_NEW_ARCH_ENABLED
-- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
- (const facebook::react::ObjCTurboModule::InitParams &)params
-{
+- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params {
return std::make_shared<facebook::react::NativeRNExitAppSpecJSI>(params);
}
|
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
[email protected]
for the project I'm working on.'React-Codegen/RNExitAppSpec/RNExitAppSpec.h' file not found
I faced this issue after upgraded RN to 0.78
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: