wix / react-native-navigation

A complete native navigation solution for React Native
https://wix.github.io/react-native-navigation/
MIT License
13.02k stars 2.67k forks source link

[iOS] - App freezing on launch #7782

Open ValentinOUI opened 11 months ago

ValentinOUI commented 11 months ago

What happened?

Hello,

Since I upgraded react-native and react-native-navigation to their latest version, my application is freezing on the login screen. More specifically, I get the following error :

*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: TypeError: Cannot read property 'startLoadWithResult' of null, js engine: hermes, reason 'Unhandled JS Exception: TypeError: Cannot read property 'startLoadWithResult' of null, js engine: hermes, stack

I already tried to remove/deintegrate pods and to reinstall them but the issue remains. I followed the migration guide and also tried different things (few differences between the migration guide and the playground) My AppDelegate.h looks like this

#import "RNNAppDelegate.h"

#import <UIKit/UIKit.h>
#import <UserNotifications/UserNotifications.h>
#import <MarketingCloudSDK/MarketingCloudSDK.h>
#import <SFMCSDK/SFMCSDK.h>

@interface AppDelegate : RNNAppDelegate <UNUserNotificationCenterDelegate, SFMCSdkURLHandlingDelegate>

@end

and here is my AppDelegate.mm :

#import "Firebase.h"
#import "AppDelegate.h"
#import "RCTLinkingManager.h"
#import "ReactNativeConfig.h"

#import <React/RCTBundleURLProvider.h>
#import <ReactNativeNavigation/ReactNativeNavigation.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];

  //SFMCSDK setup...

  //RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  //[ReactNativeNavigation bootstrapWithBridge:bridge];

  [ReactNativeNavigation bootstrapWithDelegate:self launchOptions:launchOptions];
  return YES;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge {
  return [ReactNativeNavigation extraModulesForBridge:bridge];
}

- (BOOL)concurrentROotEnabled
{
  return true;
}

// other methods for notifications handling

@end

Thank you for your help!

What was the expected behaviour?

No response

Was it tested on latest react-native-navigation?

Help us reproduce this issue!

No response

In what environment did this happen?

React Native Navigation version: 7.37.0 React Native version: 0.72.4 Has Fabric (React Native's new rendering system) enabled: (yes/no) Node version: 16.4.2 Device model: iPhone 13 (Simulator) iOS version: iOS 15.0