question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

App crashing - RuntimeException: getParameters failed (empty parameters)

See original GitHub issue

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 ---

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
MartinRobinscommented, Apr 25, 2023

@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.

1reaction
jhonatansantos61commented, May 16, 2022

@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 };

Read more comments on GitHub >

github_iconTop Results From Across the Web

Correct handling of exception: "getParameters failed ...
In my case I was getting this error : getParameters failed (empty parameters). when I called getParameters() after unlocking the camera.
Read more >
RuntimeException: getParameters failed (empty parameters)
getParameters failed (empty parameters) java.lang.RuntimeException: getParameters failed (empty parameters) at android.hardware.Camera.
Read more >
RuntimeException: getParameters failed (empty parameters)
App crashing - RuntimeException: getParameters failed (empty parameters)
Read more >
8258 - Create camera error: Fatal Exception: java.lang. ...
Issue 8258: Create camera error: Fatal Exception: java.lang.RuntimeException: getParameters failed (empty parameters).
Read more >
Android RTR Sdk crash
Hi there, I am using RTR Sdk for my client android app. ... RuntimeException: getParameters failed (empty parameters) at android.hardware.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found