-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[iOS] libc++abi: terminating with uncaught exception of type std::runtime_error: Feature flags were accessed before being overridden: fuseboxEnabledRelease #47202
Comments
Hi @benjamin-beau, thanks for the issue. Anyway, I had a look at the code and there are a couple of things that stand out:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
+ self.moduleName = @"surloMobile";
+ // You can add your custom initial props in the dictionary below.
+ // They will be passed down to the ViewController used by React Native.
+ self.initialProps = @{};
+ BOOL appLaunched = [super application:application didFinishLaunchingWithOptions:launchOptions];
+ if (!appLaunched) {
+ return NO;
+ }
[FIRApp configure];
// [REQUIRED] Register BackgroundFetch
[[TSBackgroundFetch sharedInstance] didFinishLaunching];
RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
launchOptions:launchOptions];
/* Add Background initializer for HealthKit */
[[RCTAppleHealthKit new] initializeBackgroundObservers:bridge];
- self.moduleName = @"surloMobile";
- // You can add your custom initial props in the dictionary below.
- // They will be passed down to the ViewController used by React Native.
- self.initialProps = @{};
- return [super application:application didFinishLaunchingWithOptions:launchOptions];
return appLaunched;
}
// This is a workaround because the library should not request the bridge when it is initialized.
+ #import <React/RCTBridge+Private.h>
// ...
- RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self
- launchOptions:launchOptions];
- /* Add Background initializer for HealthKit */
- [[RCTAppleHealthKit new] initializeBackgroundObservers:bridge];
+ [[RCTAppleHealthKit new] initializeBackgroundObservers:[RCTBridge currentBridge]]; Can you share the github repo of that library? That probably need to properly migrate to the New Architecture if it does not work in this way. Hope that this helps unblock you. |
This comment was marked as off-topic.
This comment was marked as off-topic.
@benjamin-beau did you solve your issue? |
Hello There, Any workaround for this? Thanks in advance |
@FaggioniHQ what's your use case? Can you see if these suggestions help you? What's happening is a misconfiguration on the App side, not on React Native: the app is trying to access the React Native runtime before it is actually initialized. I suggest you to look into your AppDelegate and into the |
Hey @cipolleschi Thanks for your reply... i solved the issue some days ago by changing some old code on the AppDelegate. Indeed was related to the |
did you solve the issue ? |
the problem is in the AppDelegate of your app, not in React Native. can you show the AppDelegate code so I can guide you through it? |
yes. im just doing that changes. i'll ping you. Thanxxx for reply. |
#import "AppDelegate.h" @implementation AppDelegate
This is my upgraded file but still its crashing |
|
The app is still crashing after migrating to 0.76 tried above given solution. still crashing. anyone having any clue? |
Hello There Like @cipolleschi says, in my case was the AppDelegate (didFinishLaunchingWithOptions method). I checked https://react-native-community.github.io/upgrade-helper/?from=0.75.2&to=0.76.3, and removed all no needed code from there Hope it helps |
This has been fixed. thanks. |
Phew!!! early to comment... I just checked in physical device. App is still crashing at least in physical device got EXC_BREAKPOINT. check screenshot |
did you tried through command i means from vscode not from xcode ? |
Using Xcode. |
try from vscode using cmd then see the error on metro |
@hemant-mali-spg can you share your AppDelegate? Also, I'd need the whole stack trace to understand what's going on. Even better, if you can provide a reproducer using this template. |
@cipolleschi , please take a look at this. It would be really helpful. I've been stuck on this for quite some time, and your assistance would be appreciated. |
From the stack trace, it looks like that a Legacy Module is going through the interop layer and it is passing a null value to a string that is expected not to be null. But I can't help more than this because it depends on your specific setup. Can you share your |
@cipolleschi here is the AppDelegate.mm #import "AppDelegate.h" #import <React/RCTBundleURLProvider.h> @implementation AppDelegate
|
Can you try with this change? I'm not sure, but if {
- if ([FIRApp defaultApp] == nil) {
- [FIRApp configure];
- }
self.moduleName = @"moduleName";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
- return [super application:application didFinishLaunchingWithOptions:launchOptions];
+ BOOL appStarted = [super application:application didFinishLaunchingWithOptions:launchOptions];
+ if ([FIRApp defaultApp] == nil) {
+ [FIRApp configure];
+ }
+ return appStarted;
} |
@cipolleschi Well, no luck yet. is there anything to check with libraries I am using? below are the libraries that does not support new arch. Library: @react-native-voice/voice, supports new architecture: false Library: @amplitude/react-native, has native dependencies, you must ask the owner could you please assist if these libs does not support new arch how to handle it? |
Which libraries are loaded when the app crashes? Then we can create a reproducer using this template, by adding those libraries and we can see what's happening. My guess is that one of them is passing a null string when we expect something that is not null, but with these steps we can isolate the faulty dependency. |
Hi @cipolleschi Sure, I will provide the details soon. There is a similar open issue here: #48065 (comment) |
Description
After upgrading RN from 74.1 to 76.0 I get the following error when launching the app in debug from Xcode :
The app works fine on Android. I tried to launch a template app (
npx @react-native-community/cli@latest init Test
) and it starts just fine. So I think it is a config issue on my side. My problem is that I don't know where to start in order to debug on this type of deep issue (c++ error). Since it is a config issue it is really complicated for me to setup a reproducer, I striped down my project to keep the bare minimum and provided the link to this.My question is : if this error is not known, how to debug this type of error ?
Steps to reproduce
React Native Version
0.76.0
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/benjamin-beau/RN_crash
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: