Skip to content
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

iOS build problem #71

Open
Francesco-Voto opened this issue Jan 22, 2024 · 15 comments · May be fixed by #72
Open

iOS build problem #71

Francesco-Voto opened this issue Jan 22, 2024 · 15 comments · May be fixed by #72

Comments

@Francesco-Voto
Copy link

Francesco-Voto commented Jan 22, 2024

Hello,

I am facing a problem with iOS build.
Currenlty I am using RN 0.73.2 and I need to build the app with static framework, so I am not 100% sure what the problem could be (if the newest Rn release or the static framework) anyway I got this error in RNExitApp.h

'React-Codegen/RNExitAppSpec/RNExitAppSpec.h' file not found` at line 10

#import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h> 

The error disappear (and I am able to build my app) if I change the line to #import <RNExitAppSpec/RNExitAppSpec.h> so probably it is just necessary to update the code.

I can open PR if you want.

Thanks

@Francesco-Voto Francesco-Voto linked a pull request Jan 23, 2024 that will close this issue
@dimisus
Copy link

dimisus commented Sep 19, 2024

I had the same, forcefully updated to 2.0.0. Reinstalled the pods. And it magically started working (rn 0.75.3).

EDIT: Nope, back at it

#if RCT_NEW_ARCH_ENABLED
#import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>
'React-Codegen/RNExitAppSpec/RNExitAppSpec.h' file not found

EDIT 2:
cd ios && pod install will install it,
it seems it is not installed when RCT_NEW_ARCH_ENABLED=1 pod install

@indrajit-roy-sc
Copy link

Facing the same issue on RN new architecture

@Degan90
Copy link

Degan90 commented Nov 20, 2024

same here

@dkahdwk
Copy link

dkahdwk commented Nov 22, 2024

same issue

@VimukthiShohan
Copy link

VimukthiShohan commented Nov 23, 2024

Same here

@indrajit-roy-sc @Degan90 @dkahdwk Any solution???

@dkahdwk
Copy link

dkahdwk commented Nov 25, 2024

@VimukthiShohan

--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
@@ -1,13 +1,13 @@
 #if __has_include(<React/RCTBridgeModule.h>)
 #import <React/RCTBridgeModule.h>
-#elif __has_include("RCTBridgeModule.h")
-#import "RCTBridgeModule.h"
+#elif __has_include(<React/RCTBridgeModule.h>)
+#import <React/RCTBridgeModule.h>
 #else
-#import "React/RCTBridgeModule.h"
+#import <React/RCTBridgeModule.h>
 #endif
 
 #if RCT_NEW_ARCH_ENABLED
-#import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>
+#import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>
 #endif
 
 @interface RNExitApp : NSObject <RCTBridgeModule>

You can run that patch.

from:
import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>

to:
import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>

@VimukthiShohan
Copy link

VimukthiShohan commented Nov 25, 2024

@dkahdwk Thanks for the help. Ran in to some errors and fixed by this flow. I will keep it if someone get this issue.

Patch is applied.

'RNExitAppSpec/RNExitAppSpec.h' file not found

Screenshot 2024-11-25 at 16 08 01

And I have replace manually pod file import. After doing that it gives following error.

5 duplicate symbols

Screenshot 2024-11-25 at 16 16 11

Solution from above error ⬇️

I found this on Apple forum. I hope this would be helpful for anyone who still facing the issue. Fixed: Add "-ld64" under Build Setting -> Other Linker Flags

https://forums.developer.apple.com/forums/thread/736590 https://developer.apple.com/forums/thread/731090

@Jamal-Ud-Din-hub
Copy link

+1

2 similar comments
@Jin-seop
Copy link

+1

@iiagodias
Copy link

+1

@UmarbekSaidov
Copy link

+1
rn 76.6

@samsonong
Copy link

@VimukthiShohan

--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
@@ -1,13 +1,13 @@
 #if __has_include(<React/RCTBridgeModule.h>)
 #import <React/RCTBridgeModule.h>
-#elif __has_include("RCTBridgeModule.h")
-#import "RCTBridgeModule.h"
+#elif __has_include(<React/RCTBridgeModule.h>)
+#import <React/RCTBridgeModule.h>
 #else
-#import "React/RCTBridgeModule.h"
+#import <React/RCTBridgeModule.h>
 #endif
 
 #if RCT_NEW_ARCH_ENABLED
-#import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>
+#import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>
 #endif
 
 @interface RNExitApp : NSObject <RCTBridgeModule>

You can run that patch.

from: import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>

to: import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>

Am on React-Native 0.76.5 and this patch works

samsonong added a commit to samsonong/react-native-exit-app that referenced this issue Jan 16, 2025
@jksjaz
Copy link

jksjaz commented Jan 16, 2025

Incase you need to patch RNExitApp.m as well:

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..4a598a3 100644
--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
@@ -7,7 +7,7 @@
 #endif
 
 #if RCT_NEW_ARCH_ENABLED
-#import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>
+#import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>
 #endif
 
 @interface RNExitApp : NSObject <RCTBridgeModule>
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..f2a8743 100644
--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
@@ -3,7 +3,7 @@
 #import "RNExitApp.h"
 
 #if RCT_NEW_ARCH_ENABLED
-#import <RNExitAppSpec/RNExitAppSpec.h>
+#import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>
 #endif
 
 @implementation RNExitApp

@samsonong
Copy link

Incase you need to patch RNExitApp.m as well:

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..4a598a3 100644
--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
@@ -7,7 +7,7 @@
#endif

#if RCT_NEW_ARCH_ENABLED
-#import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>
+#import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>
#endif

@interface RNExitApp : NSObject
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..f2a8743 100644
--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
@@ -3,7 +3,7 @@
#import "RNExitApp.h"

#if RCT_NEW_ARCH_ENABLED
-#import <RNExitAppSpec/RNExitAppSpec.h>
+#import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>
#endif

@implementation RNExitApp

Mmm is the changes to RNExitApp.mm required for the fix? I recognize and tested the RNExitApp.h part without the RNExitApp.mm

@jksjaz
Copy link

jksjaz commented Jan 18, 2025

Incase you need to patch RNExitApp.m as well:

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..4a598a3 100644
--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h
@@ -7,7 +7,7 @@
#endif

#if RCT_NEW_ARCH_ENABLED
-#import <React-Codegen/RNExitAppSpec/RNExitAppSpec.h>
+#import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>
#endif

@interface RNExitApp : NSObject
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..f2a8743 100644
--- a/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
+++ b/node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm
@@ -3,7 +3,7 @@
#import "RNExitApp.h"

#if RCT_NEW_ARCH_ENABLED
-#import <RNExitAppSpec/RNExitAppSpec.h>
+#import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>
#endif

@implementation RNExitApp

Mmm is the changes to RNExitApp.mm required for the fix? I recognize and tested the RNExitApp.h part without the RNExitApp.mm

Well for some reason it never worked for me without patching .m file. Xcode complained about not able to find this package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.