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

后端 未结 2 1347
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 22:19

I get this in logs:

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

This is leading to

2条回答
  •  粉色の甜心
    2020-12-29 22:51

    I fixed it with updating AppDelegate.m as below:

    #if RCT_DEV
    #import 
    #endif
    ...
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
      ...
      RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:jsCodeLocation
                                                moduleProvider:nil
                                                 launchOptions:launchOptions];
    #if RCT_DEV
      [bridge moduleForClass:[RCTDevLoadingView class]];
    #endif
      RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
                                                       moduleName:@""
                                                initialProperties:nil];
      ...
    }
    

    Source: devburmistro's answer Dec 10, 2017 from: https://github.com/facebook/react-native/issues/16376

提交回复
热议问题