react-native-exit-app icon indicating copy to clipboard operation
react-native-exit-app copied to clipboard

iOS build problem

Open Francesco-Voto opened this issue 1 year ago • 30 comments

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 avatar Jan 22 '24 10:01 Francesco-Voto

~~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

dimisus avatar Sep 19 '24 07:09 dimisus

Facing the same issue on RN new architecture

indrajit-roy-sc avatar Nov 06 '24 08:11 indrajit-roy-sc

same here

Degan90 avatar Nov 20 '24 17:11 Degan90

same issue

dkahdwk avatar Nov 22 '24 05:11 dkahdwk

Same here

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

VimukthiShohan avatar Nov 23 '24 16:11 VimukthiShohan

@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>

dkahdwk avatar Nov 25 '24 07:11 dkahdwk

@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

VimukthiShohan avatar Nov 25 '24 10:11 VimukthiShohan

+1

Jamal-Ud-Din-hub avatar Dec 09 '24 08:12 Jamal-Ud-Din-hub

+1

Jin-seop avatar Dec 17 '24 23:12 Jin-seop

+1

iiagodias avatar Dec 19 '24 21:12 iiagodias

@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 avatar Jan 16 '25 09:01 samsonong

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

jksjaz avatar Jan 16 '25 16:01 jksjaz

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

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

samsonong avatar Jan 17 '25 06:01 samsonong

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

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.

jksjaz avatar Jan 18 '25 04:01 jksjaz

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.

Do you think we should slide that into #76 too?

samsonong avatar Jan 20 '25 03:01 samsonong

does it work for you guys on android ? i'm getting cannot find symbol NativeRNExitAppSpec

illestomas avatar Feb 07 '25 10:02 illestomas

going from .75 to .78 ... patch does not help, still getting "file not found" on #import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>

frenbergFNX avatar Apr 08 '25 14:04 frenbergFNX

Not working in 0.79.1 with patch. Is anyone maintaining this lib?

nik098 avatar Apr 19 '25 22:04 nik098

Hello everyone,

I have also been facing this error. If anyone could provide more information.

react-native version: ^0.79.1 react-native-exit-app: 2.0.0.

The error that I have been receiving 'ReactCodegen/RNExitAppSpec/RNExitAppSpec.h' file not found on this line #import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h>.

gustavos00 avatar Apr 21 '25 08:04 gustavos00

Same issue here with:

react-native version: ^0.79.1 react-native-exit-app: 2.0.0

the patch is not working in this version :( any solutions?

michelebombardi avatar Apr 26 '25 17:04 michelebombardi

Same issue here with:

react-native: 0.79.0 react-native-exit-app: 2.0.0

the patch is not working in this version, any solution?

alexsandersarmento avatar May 09 '25 14:05 alexsandersarmento

For RN 0.79.1 i generated a patch

open RNExitApp.h and add replace import under RCT_NEW_ARCH_ENABLED with

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

open RNExitApp.mm and replace the import under #if RCT_NEW_ARCH_ENABLED with

#if RCT_NEW_ARCH_ENABLED
#import <RNExitApp/RNExitApp.h>
#endif

then run npx patch-package react-native-exit-app yarn install again or npm install then go to ios folder and run pod install again

neilanthonyte avatar May 14 '25 01:05 neilanthonyte

For RN 0.77.2

Any patch on the above is not working. The following error still happened:

node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h:10:9:
'ReactCodegen/RNExitAppSpec/RNExitAppSpec.h' file not found

peteAhn avatar May 26 '25 01:05 peteAhn

Same issue here with:

react-native: 0.79.0 react-native-exit-app: 2.0.0

the patch is not working in this version, any solution?

with react-native 0.78.2, I've changed #import <ReactCodegen/RNExitAppSpec/RNExitAppSpec.h> by #import "RNExitAppSpec.h" and it's running

Tokiarivelo avatar May 26 '25 07:05 Tokiarivelo

For RN 0.77.2

Any patch on the above is not working. The following error still happened:

node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h:10:9:
'ReactCodegen/RNExitAppSpec/RNExitAppSpec.h' file not found

@peteAhn I'm on 0.77.2 as well, the patch below works for me

`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..572fa91 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 "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..020c05a 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 "RNExitAppSpec.h" #endif

@implementation RNExitApp `

MINISOCKS avatar May 27 '25 02:05 MINISOCKS

✅ Solution In React Native 0.76+, the New Architecture is enabled by default.

  • Disable New Architecture by adding this at the top of your Podfile:

ENV['RCT_NEW_ARCH_ENABLED'] = '0'

cd ios && pod install --repo-update

I hope this works, thanks.

theagam avatar Jul 09 '25 05:07 theagam

✅ Solution I am using react native 0.80.1

I have changed RNExitApp.h file with below code #if RCT_NEW_ARCH_ENABLED #import "RNExitAppSpec.h" #endif

and RNExitApp.mm with below code #if RCT_NEW_ARCH_ENABLED #import "RNExitApp/RNExitApp.h" #endif

it's worked for me

rajibm157 avatar Jul 24 '25 08:07 rajibm157

+1

ahmedhegazydev avatar Aug 09 '25 10:08 ahmedhegazydev

✅ Solution I am using react native 0.80.1

I have changed RNExitApp.h file with below code #if RCT_NEW_ARCH_ENABLED #import "RNExitAppSpec.h" #endif

and RNExitApp.mm with below code #if RCT_NEW_ARCH_ENABLED #import "RNExitApp/RNExitApp.h" #endif

it's worked for me

it works for me :-) RN: 0.79.6

yunsung-miso avatar Aug 20 '25 07:08 yunsung-miso

@Tokiarivelo With my versions being:

"react-native": "0.82.0", "react-native-exit-app": "^2.0.0",

had the same issue. After your advice it works. Thank you! 🙏

Updates in RNExitApp.mm node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.mm

OLD:

#if RCT_NEW_ARCH_ENABLED
#import <RNExitAppSpec/RNExitAppSpec.h>
#endif

NEW:

#if RCT_NEW_ARCH_ENABLED
#import  "RNExitAppSpec.h"
#endif

Updates in RNExitApp.h node_modules/react-native-exit-app/ios/RNExitApp/RNExitApp.h

OLD:

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

NEW:

#if RCT_NEW_ARCH_ENABLED
#import  "RNExitAppSpec.h"
#endif

andro-devs avatar Oct 20 '25 12:10 andro-devs