RCTBridge required dispatch_sync to load RCTDevLoadingView. This may lead to deadlocks
// I was able to workaround the warning by updating AppDelegate.m
#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#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:@"Test"
initialProperties:nil];
...
}
// this workaround solved the warning. Thank you very much.
//For anyone using this solution, if your xcode crashes and throws an error at initWithBundleURL: jsCodeLocation, substitute jsCodeLocation =
NSURL *jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.js" fallbackResource:nil];
// This solved the issue for me