Comments (13)
Hm. Maybe this user was on an older version. I donβt see any repeats of this particular issue today. Thanks for taking a look. π
from react-native-vision-camera.
Can confirm that this is still happening with 4.3.2. Here's the symbolicated stack traces:
Fatal Exception: NSInvalidArgumentException
0 CoreFoundation 0x83f20 __exceptionPreprocess
1 libobjc.A.dylib 0x16018 objc_exception_throw
2 AVFCapture 0x59d90 __61-[AVCaptureDeferredPhotoProcessor _establishServerConnection]_block_invoke
3 libdispatch.dylib 0x3dd4 _dispatch_client_callout
4 libdispatch.dylib 0x132c4 _dispatch_lane_barrier_sync_invoke_and_complete
5 AVFCapture 0x5d7ec -[AVCaptureFigVideoDevice setActiveColorSpace:]
6 Foundation 0x147c0c -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:]
7 Foundation 0x1478ac -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:]
8 Foundation 0x1467e8 _NSSetLongLongValueAndNotify
9 AVFCapture 0xb698 -[AVCaptureSession _updateDeviceActiveFormatsAndActiveConnections]
10 AVFCapture 0x28498 -[AVCaptureSession _buildAndRunGraph:]
11 AVFCapture 0x2821c -[AVCaptureSession _commitConfiguration]
12 AVFCapture 0x20cf4 -[AVCaptureSession addOutput:]
13 <app_name> 0x6bdac8 CameraSession.configureOutputs(configuration:) + 16 (AVCapturePhotoOutput.QualityPrioritization+descriptor.swift:16)
14 <app_name> 0x6b9fe4 closure #1 in CameraSession.configure(_:) + 135 (CameraSession.swift:135)
15 <app_name> 0x8abcc thunk for @escaping @callee_guaranteed @Sendable () -> () (<compiler-generated>)
@mrousavy please consider reopening this issue.
from react-native-vision-camera.
Well then it might be an iOS bug? I don't see anything in the stacktrace that I'm doing wrong.. Also I can't reproduce this π
It's possible. We also can't reproduce this ourselves either. Seen this on 7 different devices so far in Crashlytics so it's not exactly rare.
from react-native-vision-camera.
Interesting - yea can you just set that on your end and let me know if it fixed anything? You can put that inside the configure
block.
from react-native-vision-camera.
I don't even have activeColorSpace
in the codebase. This was in V2, but not in V3 or V4. Are you sure you are on 4.0.4?
from react-native-vision-camera.
This is a completely different issue @mars-lan. Also, what is the NSInvalidArgumentException
's message? There's only a stacktrace, but no error.
from react-native-vision-camera.
This is a completely different issue @mars-lan. Also, what is the
NSInvalidArgumentException
's message? There's only a stacktrace, but no error.
My bad. Here's the missing error message for NSInvalidArgumentException
, which is why I believe it's the same issue.
Fatal Exception: NSInvalidArgumentException
*** -[AVCaptureDevice setActiveColorSpace:] Not supported - use activeFormat.supportedColorSpaces
from react-native-vision-camera.
@mars-lan you're either on VisionCamera V2 (which is by far no longer supported), or this is an Apple bug. As I said above, activeColorSpace
is not used by VisionCamera anymore.
from react-native-vision-camera.
@mars-lan you're either on VisionCamera V2 (which is by far no longer supported), or this is an Apple bug. As I said above,
activeColorSpace
is not used by VisionCamera anymore.
The app is using VisionCamera 4.3.2. You're correct that it doesn't set activeColorSpace
directly, but based on the stack traces, the function is eventually invoked by AVFCapture
:
5 AVFCapture 0x5d7ec -[AVCaptureFigVideoDevice setActiveColorSpace:]
FWIW, we've seen this issue on iOS 16.5.1, 17.3.1 & 17.5.1 for various iPhone models (12, 13, 15).
from react-native-vision-camera.
Well then it might be an iOS bug? I don't see anything in the stacktrace that I'm doing wrong..
Also I can't reproduce this π
from react-native-vision-camera.
I donβt see any repeats of this particular issue today.
Just an update that weβre still seeing this issue periodically. As @mars-lan said, it seems to affect a variety of models and iOS versions.
Per this Stack Overflow comment, a workaround may be to set automaticallyConfiguresCaptureDeviceForWideColor
to false
on the AVCaptureSession
instance. Worth a shot?
from react-native-vision-camera.
Same here, found this on firebase crashlytics + users reporting it, but can't reproduce it myself.
from react-native-vision-camera.
@mrousavy We havenβt seen this issue since we applied the workaround, although itβs only been a couple weeks. At the very least, there seem to be no undesirable side effects.
If anyone wants to try this as well and maybe get more signal, you can apply the following diff via patch-package
.
diff --git a/node_modules/react-native-vision-camera/ios/Core/CameraSession.swift b/node_modules/react-native-vision-camera/ios/Core/CameraSession.swift
index 10b0f33..587b92e 100644
--- a/node_modules/react-native-vision-camera/ios/Core/CameraSession.swift
+++ b/node_modules/react-native-vision-camera/ios/Core/CameraSession.swift
@@ -132,6 +132,9 @@ final class CameraSession: NSObject, AVCaptureVideoDataOutputSampleBufferDelegat
VisionLogger.log(level: .info, message: "configure { ... }: Updating CameraSession Configuration... \(difference)")
do {
+ // https://github.com/mrousavy/react-native-vision-camera/issues/2892
+ self.captureSession.automaticallyConfiguresCaptureDeviceForWideColor = false;
+
// If needed, configure the AVCaptureSession (inputs, outputs)
if difference.isSessionConfigurationDirty {
self.captureSession.beginConfiguration()
from react-native-vision-camera.
Related Issues (20)
- π Do you have any reference code for recording videos with overlays similar to Snapchat filters? When using the Skia frame processor, the front camera is displaying a black screen. HOT 2
- π§ ηΌθ―ζ₯ι HOT 2
- π Incorrect Barcode Scanning Results for CODE-128 HOT 3
- β¨ AI Assist to build with react-native-vision-camera HOT 1
- π In android, can i use lower version of org.jetbrains.kotlinx:kotlinx-coroutines-android, such as 1.6.4 HOT 2
- β¨ USB microphone support HOT 2
- π Coordinate system starts from top right position HOT 3
- π§ Build fail in case frame processor is enabled how ever I need to use frame processor. HOT 2
- β¨ Built-in RTMP Support in React Native Vision Camera HOT 5
- π§ Crash on build on android HOT 4
- π Cannot scan large Aztec code on Android HOT 2
- π HOT 3
- π How to set a React state from a Frame processor? HOT 3
- π frameProcessor and codeScanner are not working together on android HOT 3
- π Camera preview blank screen when using Skia Frame Processors HOT 5
- π Device torch flashing when takePhoto function called HOT 4
- π Image Compression and Frame Processing Question HOT 3
- π Fatal Error on App Initialization: IllegalArgumentException - width must be positive in CameraDeviceDetails.getFormats HOT 5
- π Unable to scan code-39 barcode. HOT 2
- π V3 is not reading Data-Matrix codes with black background on Android. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-vision-camera.