Summary
On iOS 26 only, the app crashes intermittently with a fatal NSGenericException thrown from -[AVCaptureSession startRunning] inside DynamsoftCameraEnhancer.framework. It happens when starting the barcode scanner (CameraEnhancer.open() + CaptureVisionRouter.startCapturing()). We have zero occurrences on any iOS < 26.
Environment
- dynamsoft-capture-vision-react-native: 3.4.3010
- React Native: 0.83 (Expo SDK 55)
- New Architecture: Enabled
- Affected OS: iOS 26.0 / 26.5 / 26.5.2 (never on earlier iOS)
- Devices: iPhone 17-class (iPhone18,2), high-end, arm64
- Frequency: Intermittent — 14 events / 5 users over ~7 weeks
Exception
NSGenericException: *** -[AVCaptureSession startRunning] startRunning may not be
called between calls to beginConfiguration and commitConfiguration
Crashed thread (symbols stripped for app frames; the throw is inside the framework's camera queue):
_dispatch_call_block_and_release
<DynamsoftCameraEnhancer.framework>
-[AVCaptureSession startRunning]
objc_exception_throw
__exceptionPreprocess
mechanism: nsexception, handled: no, level: fatal. Because it's thrown asynchronously on the SDK's own capture-session queue, it cannot be caught with @try/@catch around the exported RN methods.
How we call the SDK
The CameraEnhancer / CaptureVisionRouter are singletons. On mount we bind the view, open the camera, then start capturing:
CaptureVisionRouter.getInstance().setInput(CameraEnhancer.getInstance());
// ...
camera.setCameraView(view);
camera.open();
cvr.startCapturing(EnumPresetTemplate.PT_READ_BARCODES);
We already tried to work around it by deferring open() to the next frame and delaying startCapturing() by 100 ms so open()'s beginConfiguration/commitConfiguration could commit first. This does not reliably prevent the crash on iOS 26 — because open() is fire-and-forget (returns no promise and there is no "camera opened / session running" callback), there is no way from JS to know when configuration has committed before starting.
Expected behavior
CameraEnhancer should serialize beginConfiguration/commitConfiguration against startRunning internally on its capture-session queue so that open() (and any subsequent startCapturing() / torch / setCameraView calls) cannot trigger startRunning while a configuration transaction is still open — particularly under iOS 26's AVFoundation timing.
Questions
- Is this a known iOS 26 incompatibility in
DynamsoftCameraEnhancer.framework, and is a fix planned?
- Is there a newer SDK version with iOS 26 support we should upgrade to?
- Is there a supported "camera opened / session started" callback or state we can await before calling
startCapturing() / turnOnTorch(), instead of a fixed delay?
Summary
On iOS 26 only, the app crashes intermittently with a fatal
NSGenericExceptionthrown from-[AVCaptureSession startRunning]insideDynamsoftCameraEnhancer.framework. It happens when starting the barcode scanner (CameraEnhancer.open()+CaptureVisionRouter.startCapturing()). We have zero occurrences on any iOS < 26.Environment
Exception
Crashed thread (symbols stripped for app frames; the throw is inside the framework's camera queue):
mechanism:
nsexception, handled: no, level: fatal. Because it's thrown asynchronously on the SDK's own capture-session queue, it cannot be caught with@try/@catcharound the exported RN methods.How we call the SDK
The
CameraEnhancer/CaptureVisionRouterare singletons. On mount we bind the view, open the camera, then start capturing:We already tried to work around it by deferring
open()to the next frame and delayingstartCapturing()by 100 ms soopen()'sbeginConfiguration/commitConfigurationcould commit first. This does not reliably prevent the crash on iOS 26 — becauseopen()is fire-and-forget (returns no promise and there is no "camera opened / session running" callback), there is no way from JS to know when configuration has committed before starting.Expected behavior
CameraEnhancershould serializebeginConfiguration/commitConfigurationagainststartRunninginternally on its capture-session queue so thatopen()(and any subsequentstartCapturing()/ torch /setCameraViewcalls) cannot triggerstartRunningwhile a configuration transaction is still open — particularly under iOS 26's AVFoundation timing.Questions
DynamsoftCameraEnhancer.framework, and is a fix planned?startCapturing()/turnOnTorch(), instead of a fixed delay?