-
Notifications
You must be signed in to change notification settings - Fork 103
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
Code decoding stops to work after some time #105
Comments
Hi @energywave , Could you provide the sample project and step to reproduce the error? |
I'll prepare a sample project removing all the peculiarities of my app. I'll test in the hope it will behave the same (the hope is that the problem is reproducible so that it can be fixed easily). |
Hi @energywave , Just want to know if there is any chance that there is an error occur on your app logic before you setting the IsScanning to true again? |
Hm, that's a good point. I think not because I'm suspending IsScanning in two cases: a modal page i shown (for some seconds) and on return I await the navigation pop method to set IsScanning = true. The other is another page on the stack shown to disable barcode readings and, even there, I await the navigation pop method to set IsScanning = true. I'm using Microsoft AppCenter and I've never seen crashes that could lead to this problem so I tend to exclude it. But I hope tomorrow to have time to dedicate to this specific matter and create a demo project, hoping that I can simulate the problem there. I hope that, because if not then there could be some strange interaction with other components I'm using... |
Sorry that I didn't had time (yet) to create a sample project. I was using Visual Studio 2022 preview (latest version), I've now switched to Visual Studio 2022 non preview to see if I improve stability, targeting Android 12. |
I have the same problem on Android. Continuous scan with an interval of 500ms is getting a null ref exception in CameraViewRenderer line 299 Object reference not set to an instance of an object.
I moved IsScanning = false to CameraView.cs
Now the problem is gone. |
Hi, In my case this is happening when proxy?.Close(); in SafeCloseImageProxy method in Android CameraViewRenderer.cs line 410 raise the ArgumentException.
System.ArgumentException: Handle must be valid. After this exception scanning stops. I've managed to add quick and dirty workaround with calling:
|
Hi, I am having same issue with proxy closing. My use case is similar to @energywave only that my app is running on MAUI. Wanted to know if there is any progress made with this? |
News about this on MUAI? |
I have a Xamarin Forms project that run just on Android where on the main page I have the CameraView control nearly fullscreen. I'm using the latest 6.2.0-pre version from NuGet to read only QRCode with an init code like that:
As default I'm using 640x480 as camera quality and the decoding of qr codes works very well, until... it stops working at all!
It works ok for 3, 4, 5 codes or maybe for 50, it's variable, sometimes it works for long time, sometimes for just some reads.
After that the control is correctly showing camera preview but when you place a qr code in face of camera nothing happens. :(
This is NOT recovering from the situation:
The principle of my app is quite simple: it stay there to find a code and when it do (OnDetected event) I process it and show a modal form telling a message (simplified), returning to the main page with CameraView. When I show the modal form I suspend decoding using
IsScanning = false
.So the decoding is active for the majority of time.
The worse part of the problem is that I don't have a way to understand, from my code, this is happening. So, even if there is workaround, when to do it? But, clearly, a workaround could be a half solution, I could provide a button to "recover" the scanning, even if that would be very ugly.
Please if you have thoughts or something to suggest/point me to I would be grateful.
The text was updated successfully, but these errors were encountered: