iOS 15.4 - Xamarin.iOS - Crash when scanning with AVCaptureEngine
See original GitHub issueHello.
Once I updated my device to iOS 15.4, I get the following runtime exception when trying to scan using the AVCaptureEngine. I use the latest available stable version 2.4.1.
System.Exception: System.NotSupportedException: Codabar has no associated enum value on this platform. at AVFoundation.AVMetadataObjectTypeExtensions.GetValue (Foundation.NSString constant) [0x0015b] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/AVFoundation/AVMetadataObjectType.g.cs:420 at AVFoundation.AVMetadataObject.ArrayToEnum (Foundation.NSString[] arr) [0x00016] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/AVFoundation/AVMetadataObject.cs:51 at AVFoundation.AVCaptureMetadataOutput.get_AvailableMetadataObjectTypes () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/AVFoundation/AVCaptureMetadataOutput.cs:39 at ZXing.Mobile.AVCaptureScannerView.SetupCaptureSession () [0x0041b] in <04e0b9ffeac840b494808f043a3ab5ba>:0 at ZXing.Mobile.AVCaptureScannerView.<StartScanning>b__36_0 () [0x00001] in <04e0b9ffeac840b494808f043a3ab5ba>:0 at Foundation.NSActionDispatcher.Apply () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSAction.cs:62 at (wrapper managed-to-native) ObjCRuntime.Messaging.void_objc_msgSend_IntPtr_IntPtr_bool(intptr,intptr,intptr,intptr,bool) at Foundation.NSObject.InvokeOnMainThread (System.Action action) [0x00007] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSObject2.cs:619 at ZXing.Mobile.AVCaptureScannerView.StartScanning (System.Action`1[T] scanResultHandler, ZXing.Mobile.MobileBarcodeScanningOptions options) [0x00047] in <04e0b9ffeac840b494808f043a3ab5ba>:0 at ZXing.Mobile.AVCaptureScannerViewController.ViewDidAppear (System.Boolean animated) [0x0006a] in <04e0b9ffeac840b494808f043a3ab5ba>:0 at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
Issue Analytics
- State:
- Created a year ago
- Comments:6

Top Related StackOverflow Question
I had a similar problem (not using ZXing but rather iOS built-in scanning) with the same error message (Codabar has no associated enum value on this platform) but I could solve it by simply rebuilding the application with the latest version of Xamarin.iOS (15.8).
I have the impression that the AVCaptureEngine is faster than the ZXing library when specifying all barcodes, so I try to continue using it.