-
Notifications
You must be signed in to change notification settings - Fork 16
[BUG] App crash when returning to it #10
Comments
Actually, this happens quite often. If I simply leave the scanner running, lock my phone and leave it locked for a few seconds, then unlock it, this happens. |
Thanks for reporting @hsson. Have you found this on any other devices too? My aim would certainly be for this to be reported through the OnCameraErrorListener |
I can reproduce this in the emulator as well! Simply by leaving the scanner running, locking the phone (the emulators power button), leaving it locked for a few seconds, then unlocking again. Are you saying it's possible for me to catch this error and handle it myself through the OncameraErrorListener? :) |
I tried setting the |
Sorry, I mean my intention for fixing this issue would be to make it return in the OnCameraErrorListener. I will take a look this. |
Okay, sounds great! :) |
I haven't been able to create this, but if I create PR for what I think the changes should be @hsson would you be able to see if they are suitable for your needs? |
Hm okay! Well that would be great, I can test it out. I could also try and create an example app that recreates the issue. |
I did some more digging, and I'm starting to suspect that this is caused by the fact that I'm calling |
…a is released properly and report the error through the listener.
Oh ok interesting. We have just merged in a pull request which should catch the CameraAccessException and return it in the OnCameraErrorListener. If you wouldn't mind checking it reports the exception rather than crashing that would be great, even if there is another issue somewhere, it would be good to see if this resolves that. Are you able to provide your implementation to show the camera not starting? How have you chosen to implement the library: lifecycle aware or manual; xml or programmatic? Did you follow a particular sample? |
Okay I've solved the issue on my end now! I accidentally and incorrectly called |
Sorry for the headache! :) I'll see if I can get around to verifying that your pull request fixes the original issue as well! |
@hsson Ahh yes that is a silly gotcha. I'm glad you found the issue. Interestingly, even adding |
Describe the bug
After just having used the scanning functionality, then closing the app, and the re-opening the app, I encountered the following exception:
I believe this is rather rare though, but it might be good if you handled this some better way that doesn't cause the app to crash.
To Reproduce
Steps to reproduce the behavior:
Close app, and then re-open it. Doesn't happen all the time though.
Expected behavior
I expected the app to re-open with the camera view and the scanning started as normal. This is what happens most of the time, except this one time when I got the exception.
Screenshots
N/A
Smartphone (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: