react-native-restart icon indicating copy to clipboard operation
react-native-restart copied to clipboard

RNRestart.Restart(); causes error in XCode and app does not restart

Open tjkaczanko opened this issue 3 years ago • 2 comments

Code: RNRestart.Restart(); Versions: "react-native-restart": "0.0.24", "react-native": "0.63.3", Platform: iOS Error in XCode when reloading in debug:

Assertion failed: (objectCounter_ == 0 && "JSCRuntime destroyed with a dangling API object"), function ~JSCRuntime, file JSCRuntime.cpp, line 391. CoreSimulator 783.5 - Device: iPad mini (6th generation) (18447BDD-5772-468B-9DAF-3683DE595931) - Runtime: iOS 15.2 (19C51) - DeviceType: iPad mini (6th generation)

tjkaczanko avatar Mar 15 '22 16:03 tjkaczanko

Yes I see the same issue on my end as well on real device testing.

"react-native-restart": "^0.0.24", "react-native": "0.64.2",

2022-03-15 15:59:07.887046-0400 [native] Invalidating <RCTCxxBridge: 0x14b504510> (parent: <RCTBridge: 0x280ba4d20>, executor: (null)) 2022-03-15 15:59:07.888089-0400 [native] [GESTURE HANDLER] Tearing down gesture handler registered for views NSHashTable { [14] <RCTRootContentView: 0x14b5058b0; reactTag: 1; frame = (0 0; 390 844); gestureRecognizers = <NSArray: 0x282ee5410>; layer = <CALayer: 0x28208cb00>> } 2022-03-15 15:59:17.889634-0400 [native] Timed out waiting for modules to be invalidated

vip-panchal avatar Mar 15 '22 20:03 vip-panchal

Code: RNRestart.Restart(); Versions: "react-native-restart": "0.0.24", "react-native": "0.63.3", Platform: iOS Error in XCode when reloading in debug:

Assertion failed: (objectCounter_ == 0 && "JSCRuntime destroyed with a dangling API object"), function ~JSCRuntime, file JSCRuntime.cpp, line 391. CoreSimulator 783.5 - Device: iPad mini (6th generation) (18447BDD-5772-468B-9DAF-3683DE595931) - Runtime: iOS 15.2 (19C51) - DeviceType: iPad mini (6th generation)

In my case it happened for a number of reasons:

-I had a pretty outdated version of realm, which seemed to be in conflict with react-native-reanimated -I didn't have a hermes enabled -I had react-native-reanimated v2+ which requires hermes to be enabled (at least on android)

So I fixed this by upgrading to release candidate version of realm which has hermes support and enabling hermes for iOS.

Orange9000 avatar Aug 11 '22 12:08 Orange9000

Closing for now

avishayil avatar Jan 30 '23 08:01 avishayil