Closed antoinerousseau closed 1 year ago
iOS 12, RN 0.57.0 same issue.
how to resolve? or ignore is?
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings(['RCTBridge']);
Yes, I am having this issue as well after adding react-native-video, but what does it mean? It doesn't seem to prevent videos from playing. Also why are all of these third-party components causing the error? Are we missing something in developing our native modules?
Getting same issue on iOS 12.1, RN 0.57.4 without react-native-device-info
I have some issue
"lodash": "^4.17.10",
"react": "16.4.1",
"react-native": "0.56.0",
"react-native-check-box": "^2.1.0",
"react-native-collapsible": "^1.2.1",
"react-native-elements": "^0.19.1",
"react-native-google-analytics-bridge": "^5.8.0",
"react-native-google-places-autocomplete": "^1.3.9",
"react-native-map-clustering": "^1.3.0",
"react-native-maps": "^0.21.0",
"react-native-masked-text": "^1.7.2",
"react-native-modal-picker": "0.0.16",
"react-native-onesignal": "^3.2.8",
"react-native-simple-radio-button": "^2.7.2",
"react-native-svg": "^8.0.0",
"react-native-ui-kitten": "^3.0.1",
"react-native-vector-icons": "^5.0.0",
"react-navigation": "^2.11.2",
"rn-sliding-up-panel": "^1.2.1",
"victory-native": "^30.5.0"
In IOS getting "RCTBridge required dispatch_snyc to load RCTDevLoadingView This may lead to deadlocks."
Maybe you should Project -> Clean
in your Xcode, then re-run your application.
I've confirmed that this comment is the solution. Thank you @mattijsf!
Find your RCTBridgeDelegate
and override the extraModulesForBridge
method.
@interface MyBridgeDelegate : NSObject <RCTBridgeDelegate>
@end
@implementation MyBridgeDelegate
- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
return @[
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]],
#endif
];
}
@end
class MyBridgeDelegate: NSObject, RCTBridgeDelegate {
func extraModules(for bridge: RCTBridge!) -> [RCTBridgeModule]! {
var modules: [Any]! = []
if RCT_DEV == 1 {
modules.append(bridge.module(for: RCTDevLoadingView.self))
}
return modules as? [RCTBridgeModule]
}
}
Repro on iOS12, RN 0.57.8
my dependency,the same issue
@aleclarson what exactly does that code do?
@ccorcos It loads the RCTDevLoadingView
earlier, so it doesn't have to block the main thread when it's loaded by RN. This comment might be an easier solution for you.
Not sure if this is still happening for others but it still happening for me with RN 0.57.8 + iOS 11.3 (at least)
I'm using the change from the comment above by @devburmistro successfully
Facing this issue
RN 0.58.3 iOS 11.4, 12.1
and it does lead to deadlock. It happens to me when I closing custom modal
I haven't had this on previous 0.57.8 which was just fine
Same here, getting this after upgrading to RN 0.58.3
my exact error is: Unable find module for DevLoadingView
, the solutions above do not fix it for me
Seems related to this commit, which has in fact added on RN 0.58.3
I am experiencing the same "Unable to find module for DevLoadingView" issue as @oferRounds after upgrading to RN 0.58.3 today.
It seems to trigger when an app is first opened in the simulator. Subsequent reloads (cmd-R) do not present the error.
EDIT: filed a separate issue for this specific error: #23235
I can also confirm that this is still an issue on iOS with 0.58.3.
Some interesting observations:
Edit: I can confirm that this workaround is still a viable solution.
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 worked for me.
Has anyone been able to register a custom RCTBridgeDelegate while using react-native-navigation? You should be able to pass a delegate via the bridgeManagerDelegate
param, but it seems broken (the RCTBridge provided to extraModulesForBridge
is always nil
).
I just started getting this immediately after adding react-native-device-info
on RN 0.58.6 and iOS 12.
OK, this comment seems to have fixed it for me.
React Native 0.59.1
I start seeing this warning right after installing react-native-device-info as well, any real solution?
I'm seeing this randomly as well, and I have made no changes in my app code other than what's necessary (config) to make everything work again, in upgrading from RN 0.57.8 to 0.59.5. In my case, lib in question is CodePush, with 2 yellowbox warnings:
RCTBridge required dispatch_sync to load CodePush. This may lead to deadlocks
and
Required dispatch_sync to load constants for CodePush. This may lead to deadlocks
This issue is long. I assume nailing down the root cause is still a mystery? Let me know what other debug info I can provide to help.
i fixed this error by @grossingdev comment. but after updating react-native to 0.59.8 version. this error has come again
At react-native 0.59.3, here is what the code should look like to workaround the problem:
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"YourAppName"
initialProperties:nil];
Facing the same warning after updating the AppDelegate.m file while Integrating the react-native-maps
google map in ios App.
"react-native": "0.59.5"
For me -- this worked --- "react": "16.8.3", "react-native": "0.59.9", AppDelegate.m file
#if RCT_DEV
#import <React/RCTDevLoadingView.h>
#endif
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
// RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
// moduleName:@"mobileapp"
// initialProperties:nil];
NSURL *theurl ;
#if DEBUG
theurl = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
theurl = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
RCTBridge *bridge = [[RCTBridge alloc] initWithBundleURL:theurl
moduleProvider:nil
launchOptions:launchOptions];
#if RCT_DEV
[bridge moduleForClass:[RCTDevLoadingView class]];
#endif
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
moduleName:@"mobileapp"
initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}
@amitkumar3968 format your comment as code
I just got similar error:
Reload fixed it, but seems something isn't right if this happens randomly.
This issue only happens to me when I deactivate the debugger. When opening the Perf Monitor, I noticed that the RAM goes from ±100MB to ±300MB after deactivating.
With debugger:
Without debugger:
The proposed workaround does not work in my case, since it only stops displaying the warning, but it does not solve the problem with memory.
I wonder if this problem would affect the performance of the app in release mode.
The aforementioned workaround solved this problem for me as well, on React Native 0.59.10
:
diff --git a/ios/Foo/AppDelegate.m b/ios/Foo/AppDelegate.m
index e446e79..2c28719 100644
--- a/ios/Foo/AppDelegate.m
+++ b/ios/Foo/AppDelegate.m
@@ -18,6 +18,11 @@
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
+// https://github.com/facebook/react-native/issues/16376#issuecomment-350523177
+#if RCT_DEV && __has_include(<React/RCTDevLoadingView.h>)
+#import <React/RCTDevLoadingView.h>
+#endif
+
@implementation AppDelegate
@@ -39,6 +44,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
+
+ // https://github.com/facebook/react-native/issues/16376#issuecomment-350523177
+ #if RCT_DEV && __has_include(<React/RCTDevLoadingView.h>)
+ [bridge moduleForClass:[RCTDevLoadingView class]];
+ #endif
+
RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"Foo" initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
The only difference here is that I matched the exact same logic for loading it (the RCT_DEV && __has_include(<React/RCTDevLoadingView.h>)
part)...
Just got 2 with react-native-firebase
. Happens rarely but:
I was able to re-create this issue by adding app icons to the Images.xcassets/AppIcon.appiconset
directory of my newly created test project using react-native 0.61.2. Adding the lines of code mention in this issue solved the issue for me.
react-native 0.59.10 same issue.
same issue here!! any body solved this problem?
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.
Same issue, but if I delete block of code componentDidUpdate, this warning dissappear. But but but but I need componentDidUpdate.
first : open Xcode, normaly Xcode answer if you want install a component : click install
When you update macOS software, you must open Xcode for update
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]; ... }
@grossingdev what is the jsCodeLocation please? I know it's supposed to be a URL but what should it point to?
Just got 2 with
react-native-firebase
. Happens rarely but:![]()
Firebase is causing this error for me. Mind sharing how you solved it? @fungilation
@abdi4 I just ran into this too, did you manage to solve it?
@zloka no this happens randomly and im not able to recreate it
Simplest way to ignore this or any other warning is
import { YellowBox } from 'react-native';
YellowBox.ignoreWarnings([
'RCTBridge'
]);
This issue arises for me non-deterministically. The only fix I have whenever it does, is to delete the app from my device and re-run.
Swift Solution:
let bridge = RCTBridge(bundleURL: jsCodeLocation, moduleProvider: nil, launchOptions: nil)
bridge?.module(for: RCTDevLoadingView.self)
#endif
let rootView = RCTRootView(bridge: bridge!, moduleName: "AppMain", initialProperties: nil)
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Here's your activity. The warning continue to pops up in fresh new apps.
I randomly get this warning at iOS app start (i.e. not always).
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
OS: macOS Sierra 10.12.6 Node: 6.10.2 Yarn: 1.0.2 npm: 5.4.2 Watchman: 4.7.0 Xcode: Xcode 9.0 Build version 9A235 Android Studio: 2.1 AI-143.2915827
Packages: (wanted => installed) react: ^16.0.0 => 16.0.0 react-native: ^0.49.3 => 0.49.3
Steps to Reproduce
Expected Behavior
No warning
Actual Behavior
Reproducible Demo
N/A
Some packages I use
https://github.com/antoinerousseau/react-native-custom-components https://github.com/rebeccahughes/react-native-device-info https://github.com/evollu/react-native-fcm https://github.com/gwmccull/react-native-polyfill https://github.com/getsentry/react-native-sentry