Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RCTBridge required dispatch_sync to load RCTDevSettings. This may lead to deadlocks

Tags:

react-native

When I upgrade RN from 0.32 to 0.44, react to 16.0.0-alpha.6. When I operate the app on Xcode .I get the errors:

enter image description here

like image 287
kangya Avatar asked May 22 '17 08:05

kangya


1 Answers

Open Your /ios/YourAppName/AppDelegate.m

#import "AppDelegate.h"

// ADD THIS
#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif
// TILL HERE

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
...

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

...
  RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation
                                            moduleProvider:nil
                                             launchOptions:launchOptions];
// THIS CONDITION
#if RCT_DEV
  [bridge moduleForClass:[RCTDevLoadingView class]];
#endif
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                   moduleName:@"Test"
                                            initialProperties:nil];
// TILL HERE
  ...
}

Worked for me! Source here

like image 138
Hussain Pettiwala Avatar answered Oct 18 '22 18:10

Hussain Pettiwala