Redth / ZXing.Net.Maui

Barcode Scanning for MAUI?
MIT License
437 stars 146 forks source link

Getting System.ArgumentNullException exception on MAUI .Net7 #100

Closed Cael00 closed 1 year ago

Cael00 commented 1 year ago

I'm trying to run the example code using version 0.3.0 preview.1 in a MAUI .Net7 project. It works fine when I run it on Android. But trying it on iOS throws the following error:

System.ArgumentNullException has been thrown.
Value cannot be null. (Parameter 'device')

Any help or suggestion?

Cael00 commented 1 year ago

Turns out it only works perfect on a physical device, not a simulator. I made a component that creates the reader only if it runs on a device; otherwise, it creates a fake image to serve as a placeholder.