Scandit / scandit-react-native-datacapture-barcode

0 stars 4 forks source link

ScanditDataCaptureBarcodeCapture invalidate causing crash when calling RNRestart.Restart() #5

Closed samzmann closed 2 years ago

samzmann commented 2 years ago

I am using react-native-restart in my app. Since adding Scandit, calling RNRestart.Restart() crashes the app with the following error:

2022-01-03 15:35:34.435362-0500 VytalPartnerApp[4255:1644787] [native] Invalidating <RCTCxxBridge: 0x1066192e0> (parent: <RCTBridge: 0x282295880>, executor: (null))
2022-01-03 15:35:34.436970-0500 VytalPartnerApp[4255:1644986] [native] [GESTURE HANDLER] Tearing down gesture handler registered for views NSHashTable {
[12] <RCTRootContentView: 0x10661c170; reactTag: 1; frame = (0 0; 375 667); gestureRecognizers = <NSArray: 0x2807e8e40>; layer = <CALayer: 0x2809dc3c0>>
}
2022-01-03 15:35:34.437533-0500 VytalPartnerApp[4255:1644979] -[ScanditDataCaptureBarcodeCapture invalidate]: unrecognized selector sent to instance 0x281c18640
2022-01-03 15:35:34.440398-0500 VytalPartnerApp[4255:1644979] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ScanditDataCaptureBarcodeCapture invalidate]: unrecognized selector sent to instance 0x281c18640'
*** First throw call stack:
(0x186cd5cac 0x19dd44758 0x186da56d0 0x186c6fc18 0x186c6f14c 0x1048d004c 0x1048d00a0 0x104463c14 0x1062c094c 0x1062c21c8 0x1062c9358 0x1062c9fe0 0x1062d5630 0x1e070af38 0x1e070aaa4)
libc++abi: terminating with uncaught exception of type NSException
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ScanditDataCaptureBarcodeCapture invalidate]: unrecognized selector sent to instance 0x281c18640'
terminating with uncaught exception of type NSException

Any idea how to fix this?

I'm on:

ScanditSupport commented 2 years ago

Hi @LaVielle,

We have tried to reproduce this issue with a clean build and did not observe the same behaviour. Therefore, it seems it might be specific to some particular dependency causing compatibility issues or your particular project setup.

Can you please reach out to us directly and share a few snippets of your code on how you implemented Scandit as well as your package.json?

Submit a request – Frequently Asked Questions (FAQ): https://support.scandit.com/hc/en-us/requests/new.

samzmann commented 2 years ago

Changing the inlineRequires config from false to true in metro.config.js seems to do the trick.

ScanditSupport commented 2 years ago

@LaVielle we can confirm that your suggestion "Changing the inlineRequires config from false to true in metro.config.js" is a valid workaround. We will add a fix and further optimizations in the upcoming 6.11 version.

Best regards Scandit Support

ScanditSupport commented 2 years ago

@LaVielle this should be resolved now in 6.12.0