react-native-exception-handler icon indicating copy to clipboard operation
react-native-exception-handler copied to clipboard

Not showing native exception UI on iOS

Open mark-friedman opened this issue 6 years ago • 6 comments

My app just crashes, with no exception UI being shown. I'm setting the native exception handling as follows in my code:

    setNativeExceptionHandler((exceptionString) => {
    });

I am using rn-test-exception-handler to cause the exception in this app.

I am seeing the following logged before the app crashes:

2018-06-19 16:48:57.378263-0700 ThunkableCompanion[19184:43689367] Exception 'THIS IS A TEST EXCEPTION' was thrown while invoking raiseTestNativeError on target RnTestExceptionHandler with params (
)
callstack: (
	0   CoreFoundation                      0x00000001142701e6 __exceptionPreprocess + 294
	1   libobjc.A.dylib                     0x00000001126ea031 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001142e5975 +[NSException raise:format:] + 197
	3   ThunkableCompanion                  0x000000010b496daa -[RnTestExceptionHandler raiseTestNativeError] + 90
	4   CoreFoundation                      0x00000001141f3ccc __invoking___ + 140
	5   CoreFoundation                      0x00000001141f3b84 -[NSInvocation invoke] + 308
	6   CoreFoundation                      0x000000011420c8d6 -[NSInvocation invokeWithTarget:] + 54
	7   ThunkableCompanion                  0x000000010aba2a7c -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2796
	8   ThunkableCompanion                  0x000000010ac3b112 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 786
	9   ThunkableCompanion                  0x000000010ac3ac3f _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 127
	10  ThunkableCompanion                  0x000000010ac3abb9 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25
	11  libdispatch.dylib                   0x00000001155a1807 _dispatch_call_block_and_release + 12
	12  libdispatch.dylib                   0x00000001155a2848 _dispatch_client_callout + 8
	13  libdispatch.dylib                   0x00000001155ad92b _dispatch_main_queue_callback_4CF + 628
	14  CoreFoundation                      0x0000000114232c99 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
	15  CoreFoundation                      0x00000001141f6ea6 __CFRunLoopRun + 2342
	16  CoreFoundation                      0x00000001141f630b CFRunLoopRunSpecific + 635
	17  GraphicsServices                    0x0000000117163a73 GSEventRunModal + 62
	18  UIKit                               0x000000010f9fc0b7 UIApplicationMain + 159
	19  ThunkableCompanion                  0x000000010aaa5c2f main + 111
	20  libdyld.dylib                       0x000000011561f955 start + 1
)
reactConsoleErrorHandler @ index.bundle:12399
console.error @ index.bundle:45360
logToConsole @ index.bundle:18772
logIfNoNativeHook @ index.bundle:18755
__callFunction @ index.bundle:7562
(anonymous) @ index.bundle:7391
__guard @ index.bundle:7533
callFunctionReturnFlushedQueue @ index.bundle:7390
(anonymous) @ debuggerWorker.js:72

I attempted to debug this in Xcode and set breakpoints at the beginning of handleException() in ReactNativeExceptionHandler.m but the code never seemed to get to that breakpoint. Instead I just got continual exceptions within React Native's invokeInner() method (in RCTNativeModule.mm)

The error that appears there in Xcode is:

Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)

I am also seeing a yellow box in my app (which I'm running in React Native's Dev/Debug mode) with the following message. It's not clear whether that is relevent but I'm noting it hear for completeness.

RCTBridge required dispatch_sync to load RCTDevLoadingView.  This may lead to deadlocks.

mark-friedman avatar Jun 20 '18 00:06 mark-friedman

i have the same issue as yours

zzlandroid avatar Jul 24 '18 09:07 zzlandroid

me too

sxqwaade avatar Aug 24 '18 07:08 sxqwaade

I have the same problem.

First, I tried to build a release app, by setting release schema under Product > Scheme > Edit Scheme > Run > Release.

Then, I generated an .ipa archive with Product > Archive and installed it on the device. To install the app, I connected the device, then selected Window > Devices and Simulators and dragged the .ipa archive in Installed Apps.

In neither case the exception was caught (but we can see in the XCode logger that the exception is thrown).

N.B.: On Android it works, and I can see the default native handler.

zuccha avatar Jan 28 '19 08:01 zuccha

any solution here?I met this issue too.

Symous avatar Mar 20 '19 13:03 Symous

Any solutions???

LucasHimelfarb avatar Apr 05 '22 16:04 LucasHimelfarb