-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
0.71 how to avoid RCTAppDelegate and switch back to old way #35818
Comments
Hi @billnbell There are different solutions to your problem. -@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, RNAppAuthAuthorizationFlowManager, UNUserNotificationCenterDelegate>
+@interface AppDelegate : RCTAppDelegate <UIApplicationDelegate, RCTBridgeDelegate, RNAppAuthAuthorizationFlowManager, UNUserNotificationCenterDelegate>
On the other end, RCTAppDelegate is completely optional. You don't need to use it. If you don't want it, just keep your old implementation and everything should work as before. But you will have to always do some manual steps to migrate your app. Let me know if it works. |
OK - do I need all or just the new ones? I did the following and it appeared to work ok ? I dropped UIApplicationDelegate, RCTBridgeDelegate
|
Yep, you can drop these as
What do you mean with all and just the new ones? 😅 Sorry, but I'm not sure I'm following here...
The changes looks good to me. What you should also do is to remove all the implementation code that you may have in your // In your AppDelegate.mm
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Replace `HelloWorld` with the name of your app
self.moduleName = @"HelloWorld";
// put all your initialization code here
// ...
// Remember to invoke super to initialize React Native.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
} Let me know if it works! |
This is work, thank you very much! |
i am facing same problem RCTAppDelegate.h file not found |
@TomarVidhi04 hi there! Just to make sure that the setup is correct: did you update React Native, run Yarn and reinstall the pods with It could be that you forgot one of the above steps and React Native did not downloaded the file. To make sure about that, can you check whether in the Pods project, Development Pods, you have a folder called |
@TomarVidhi04 As for the Is it possible to build the project from the command line with Make sure to open the workspace (
with the If you opened only the Once you build the project from within the opened workspace, it should be fine. Hopefully that does the trick. 🤞 |
Hi @ucheNkadiCode. Version 0.71.7 works properly. There is something dirty in your system. Please try to:
At this point, you should have the most recent scripts, a clean situation and the most recent pods for your version. Let me know if this works! |
Hey @cipolleschi Thank for your help! Now my app is able to properly find RCTApp delegate! for some reason however, In my AppName-Bridging-Header I'm still seeing 'react/RCTEventEmitter.h file not found'. It's also still not in my react pods either |
Hi @ucheNkadiCode, I think you can safely remove that line from the the bridging headers. We are not generating that file, Cocoapods/Xcode does that automatically. So, probably, it has been generated when you were having trouble compiling/building. Let's try to remove the line and see what happens. You should also have that file, though. It should be in the This is a new App I created from 0.71.7. |
Hi @cipolleschi, I have applied all your solutions but it doesn't work. Can you give me more solutions? I upgraded React native version from 0.64 to 0.7.18. I have no problem in but I get an error This is my
|
Hi @anhdo9797. First of all, notice that Flipper is incompatible with frameworks, so you'd have to set this: Then, I did some tests:
I'm start thinking that the problem could come from some of your dependency, as a vanilla project works as expected. As tentative test, given that I cant repro it locally, could you try to apply this change in your -#import <RCTAppDelegate.h>
+#import <React_RCTAppDelegate/RCTAppDelegate.h> In theory, Xcode should be able to resolve the |
Thank @cipolleschi, It works for me |
I have the exact same issue. I upgraded from 0.69 to 0.71 and I'm continuously having this issue for iOS. Android works fine. Since I'm also using Firebase via the react-native-firebase project I cannot use Flipper as I need to use frameworks. I see React-AppDelegate project in my pods directory. Cheers! |
Can you try to use this import statement in your AppDelegate? -#import <RCTAppDelegate.h>
+#import <React_RCTAppDelegate/RCTAppDelegate.h> |
could you try to set up a minimal reproducer using this repo This is a recurring problem, so I really want to solve it once and for all, but not using Firebase directly, I don't know which steps to follow to reproduce it. |
i will try to do that. But generally a new project with the same rn version 0.71 worked fine when i tried some weeks ago. |
Hi, I cannot reproduce it with the repo or a new project. After adding all my dependencies it just builds and runs. |
Bust open Xcode and build from there. Most of the time it will give you more errors. |
I know it sounds stupid - but reboot. |
I had hopes about this but seems to have no effect :( |
tried building both from the command line and from xcode. but I have the same issue... am I right in assuming that it has something to do with the search paths? |
Not really, it has to do with how Xcode packages the frameworks and where the files are put. which influences the header search path, but that's not the root cause.
|
Hi @cipolleschi, first of all thanks a lot for the detailed input.
|
If you managed to run it on a real device but not a simulator, try to cleanup the derived data. It could be that Xcode has something cached for the simulator builds that makes those build fail. |
In my case, I created multiple targets, and header search paths of these target missed some value for example |
Hi, I have literally tried every solution there is on GitHub and stack overflow regarding this error and nothing works for me. I'm on 0.72.7 and I am also getting the AppDelegate.h not found issue. |
Hi @jpouabou, I'm sorry you are hitting this problem. A few questions to help you out:
|
Hello, I'm just getting the same error but on xcode cloud. Does the above solutions work on xcode cloud? |
Hi @developersflex! I think it depends on the error. I have never used Xcode cloud, so I don't know what you can do on/with it. |
Description
I want to upgrade to 0.71.
But I have custom PROTOCOLS...
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, RNAppAuthAuthorizationFlowManager, UNUserNotificationCenterDelegate>
How do I ignore RCTAppDelegate and use my own UIResponders?
My build cannot find : RCTAppSetupPrepareApp(application);
I get no found on build.
Version
0.71.0
Output of
npx react-native info
no
Steps to reproduce
RCTAppDelegate just remove from AppDelegate
Snack, code example, screenshot, or link to a repository
no
The text was updated successfully, but these errors were encountered: