Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: NSInvalidArgumentException #1297

Open
vlazdra opened this issue Jan 17, 2025 · 6 comments · May be fixed by #1309
Open

Fatal Exception: NSInvalidArgumentException #1297

vlazdra opened this issue Jan 17, 2025 · 6 comments · May be fixed by #1309
Assignees

Comments

@vlazdra
Copy link

vlazdra commented Jan 17, 2025

Hi, I'm getting this crash report in Crashlytics. There aren't that many events, so just sharing if it's of any value to maybe take a look.

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x2d5ec __exceptionPreprocess
1  libobjc.A.dylib                0x31244 objc_exception_throw
2  AVFCapture                     0x21e44 -[AVCaptureSession addInput:]
3  Runner                         0x11a31c8 MobileScanner.start(barcodeScannerOptions:cameraPosition:torch:detectionSpeed:completion:) + 222 (MobileScanner.swift:222)
4  Runner                         0x11ab3ec specialized MobileScannerPlugin.start(_:_:) + 142 (MobileScannerPlugin.swift:142)
5  Runner                         0x11ad564 specialized MobileScannerPlugin.handle(_:result:) + 101 (MobileScannerPlugin.swift:101)
6  Runner                         0x11a757c @objc MobileScannerPlugin.handle(_:result:) (<compiler-generated>)
7  Flutter                        0xb2b510 (Missing UUID 4c4c442055553144a1a57b0af810dad9)
8  Flutter                        0x49ec3c (Missing UUID 4c4c442055553144a1a57b0af810dad9)
9  libdispatch.dylib              0x2248 _dispatch_call_block_and_release
10 libdispatch.dylib              0x3fa8 _dispatch_client_callout
11 libdispatch.dylib              0x12a34 _dispatch_main_queue_drain
12 libdispatch.dylib              0x1264c _dispatch_main_queue_callback_4CF
13 CoreFoundation                 0x79bbc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
14 CoreFoundation                 0x761b0 __CFRunLoopRun
15 CoreFoundation                 0xc8274 CFRunLoopRunSpecific
16 GraphicsServices               0x14c0 GSEventRunModal
17 UIKitCore                      0x3ee77c -[UIApplication _run]
18 UIKitCore                      0x14e64 UIApplicationMain
19 UIKitCore                      0x751a7c keypath_get_selector_hoverStyle
20 Runner                         0x8d90 main (AppDelegate.swift)
21 ???                            0x1c3740de8 (Missing)

Device data

Device
Model: iPhone 14 Pro
Orientation: Portrait
RAM free: 150.64 MB
Operating System
Version: 18.2.1
Orientation: Portrait
Jailbroken: No
@navaronbracke
Copy link
Collaborator

@navaronbracke
Copy link
Collaborator

navaronbracke commented Jan 17, 2025

Hmm, maybe we should guard this with canAddInput ?

https://developer.apple.com/documentation/avfoundation/avcapturesession/canaddinput(_:)

Worth investigating, though.

@navaronbracke navaronbracke self-assigned this Jan 17, 2025
@vlazdra
Copy link
Author

vlazdra commented Jan 17, 2025

Hey @navaronbracke, sorry forgot to actually mention the library version.

The version that reported this issue to Crashlytics is 6.0.1.
However I had a release a couple of days ago with 6.0.2 and so far there are no issues being logged.

If you guys are handling this issue, awesome. 🙌

@navaronbracke
Copy link
Collaborator

The bug itself might be tricky to reproduce, but I think that Apple's guidance on the API is what we should follow to fix it.

I'll look into fixing it for an upcoming release shortly (will be OOO for the rest of the day though)

@navaronbracke navaronbracke linked a pull request Jan 28, 2025 that will close this issue
@navaronbracke
Copy link
Collaborator

@vlazdra I did put up a fix for this issue, so you can expect this in an upcoming release, pending potential cherry picks to 6.0.x. Otherwise this will be available in the next version 7.0.0 beta.

@vlazdra
Copy link
Author

vlazdra commented Jan 28, 2025

@navaronbracke Awesome to hear that. Thank you for the effort! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants