React-native-navigation: [V2][iOS] Multiple modals crash during debug mode

Created on 11 Apr 2019  ·  8Comments  ·  Source: wix/react-native-navigation

Issue Description

More than 1 modal opens fine. But upon closing, there's a native signal. Only happens during when DEBUG is on.

Steps to Reproduce / Code Snippets / Screenshots

RNNRootViewController.m
-(void)cleanReactLeftovers {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self.view];
self.view = nil;
self.navigationItem.titleView = nil; // crashes
self.navigationItem.rightBarButtonItems = nil;
self.navigationItem.leftBarButtonItems = nil;
}

This seems to fix it:
-(void)cleanReactLeftovers {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self.view];
self.view = nil;
#if !DEBUG
self.navigationItem.titleView = nil;
self.navigationItem.rightBarButtonItems = nil;
self.navigationItem.leftBarButtonItems = nil;
#endif
}


Environment

  • React Native Navigation version: 2.17.0
  • React Native version: 0.59.3
  • Platform(s): iOS
  • Device info: Simulator and device, Debug only
iOS acceptebug

Most helpful comment

Hey guys, thanks for reporting. we're aware of a few crashes on iOS in version 2.17.0 and will address them next week. Sorry for the inconvenience.

All 8 comments

Confirm that issue in our app.

It triggers EXC_BAD_ACCESS on the line with self.navigationItem.titleView = nil

That code is supposed to prevent potential leaks. Luckily I've only seen issues in DEBUG. Even though it's not the best solution but leaks are not as crucial in DEBUG.

Does that sound like an acceptable solution?

@chyrta for you also release works as expected and issue is only when in DEBUG?

Our team experienced a few critical issues after upgrading to 2.16.0 and 2.17.0. That's why we decided to stay on 2.11.0 with additional fixes in our fork and temporarily don't use 2.17.0 in our production.

Experiencing the same with 2.17.0

Hey guys, thanks for reporting. we're aware of a few crashes on iOS in version 2.17.0 and will address them next week. Sorry for the inconvenience.

We are encountering the same issue. Sometimes its working but mostly my app crashes in DEBUG mode.

Already fixed in master. will be available in the next version.
Available to test with the latest snapshot: 2.17.0-snapshot.282

Was this page helpful?
0 / 5 - 0 ratings

Related issues

birkir picture birkir  ·  3Comments

switchtrue picture switchtrue  ·  3Comments

charlesluo2014 picture charlesluo2014  ·  3Comments

EliSadaka picture EliSadaka  ·  3Comments

kiroukou picture kiroukou  ·  3Comments