ZXing.Net.Mobile: App crashing - RuntimeException: getParameters failed (empty parameters)

The app crashes when navigating away from the scanner page, then back to the scanner page. Also when changing the orientation by rotating the device a few times. I’m using FreshMVVM as an MVVM framework if that is relevant.

Usage:

<Grid>
    <zxing:ZXingScannerView x:Name="ScannerView"
        Result="{Binding ScanResult, Mode=OneWayToSource}"
        ScanResultCommand="{Binding ProcessBarcodeCommand}"
        IsScanning="{Binding IsScanning}"
        IsAnalyzing="{Binding IsAnalyzing}" />
    <zxing:ZXingDefaultOverlay x:Name="ScannerOverlay"
        TopText="Hold your phone up to the QR code"
        BottomText="Scanning will happen automatically"
        ShowFlashButton="True"/>

Full stack trace: https://hastebin.com/ulequfucim.sql

05-23 13:35:13.757 E/mono-rt (24409): [ERROR] FATAL UNHANDLED EXCEPTION: Java.Lang.RuntimeException: getParameters failed (empty parameters)
05-23 13:35:13.757 E/mono-rt (24409):   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <f32579baafc1404fa37ba3ec1abdc0bd>:0 
05-23 13:35:13.757 E/mono-rt (24409):   at Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00069] in <09bf3e262b934ffab2ba01f9fc7fd54d>:0 
05-23 13:35:13.757 E/mono-rt (24409):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0002a] in <09bf3e262b934ffab2ba01f9fc7fd54d>:0 
05-23 13:35:13.757 E/mono-rt (24409):   at Android.Hardware.Camera.GetParameters () [0x0000a] in <25661073a35344a89f215a4cf81af37c>:0 
05-23 13:35:13.757 E/mono-rt (24409):   at ZXing.Mobile.CameraAccess.CameraController.ApplyCameraSettings () [0x00033] in <819b29aa6d91462699e19a679be55a44>:0 
05-23 13:35:13.757 E/mono-rt (24409):   at ZXing.Mobile.CameraAccess.CameraController.RefreshCamera () [0x00010] in <819b29aa6d91462699e19a679be55a44>:0 
05-23 13:35:13.757 E/mono-rt (24409):   at ZXing.Mobile.CameraAccess.CameraAnalyzer.RefreshCamera () [0x00001] in <819b29aa6d91462699e19a679be55a44>:0 
05-23 13:35:13.757 E/mono-rt (24409):   at ZXing.Mobile.ZXingSurfaceView+<OnWindowFocusChanged>d__29.MoveNext () [0x0008f] in <819b29aa6d91462699e19a679be55a44>:0 
05-23 13:35:13.757 E/mono-rt (24409): --- End of stack trace from previous location where exception was thrown ---

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 23 (1 by maintainers)

Commits related to this issue

Most upvoted comments

@Jerome-Liger

That is excellent news. I don’t need Tizen/MacOS/UWP either, just Android and maybe iOS so that is perfect (and I promise not to hold you responsible either). Thanks for taking the time and effort, both for the fix and for responding to me.

@jhonatansantos61Tentei entrar em contato com vários desenvolvedores que trabalham com Xamarin… também alguns profissionais reais. Eles não foram capazes de corrigi-lo. Isso acontece em situações que você descreve, mas também quando você deseja voltar para a página onde o scanner está localizado. Acho que há um problema com o pacote, parece que ainda não há solução para isso 😦

I configured ZXing in the page builder and it worked correctl

cameraQrCode.Options = new ZXing.Mobile.MobileBarcodeScanningOptions { DelayBetweenAnalyzingFrames = 200, DelayBetweenContinuousScans = 5000, TryHarder = true };