-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
IllegalStateException: CameraInstance is not open #272
Comments
|
Hi,
May I know what are the possible ways on why the "IllegalStateException: CameraInstance is not open" is triggered? |
That error is when the app was not able to open the Camera. It can happens for several reasons like the app didn't request camera permission, or the camera is already opened by the same/other app,.. I was happening that problem once when tried to show the scanner for the 2nd time and then I noticed that although I was removing the camera preview from the screen, I was not closing it, so when I tried to show the scanner again, it failed to open. Are you using any of the samples or the IntentIntegrator? |
Sorry for the late reply. I tried to manually disable camera permission on Marshmallow device but the error didn't happen. I am using the Embedded BarcodeView. |
@ekahannah When this happens, there is typically also another error a few lines earlier with more details on why the camera could not be opened (e.g. camera already in use). A non-obfuscated stack trace will also help. |
Hi, I experienced the same issue, here the stack trace and some info Exception java.lang.IllegalStateException: CameraInstance is not open User Performance Device Error |
Sorry, when you see only .METHOD_NAME instead of the full class path there is an OR, firebase gave me the stacktrace as I pasted |
hi @rkistner, Faced with similar problem and do have stacktrace of all threads, captured by fabric - |
I experienced the same issue , com.journeyapps.barcodescanner.camera.CameraInstance.validateOpen(CameraInstance.java:181)2 com.journeyapps.barcodescanner.camera.CameraInstance.requestPreview(CameraInstance.java:169) |
I've seen the same crash here in some of my users' reports. Speaking of which, shouldn't the open variable be synchronized? Since it's both read and written to from different threads. |
Facing the same issue. I was wondering as to why do we have to crash in this scenario? |
Samsung Grand Prime Plus (grandpplte), 1536MB RAM, Android 6.0 at com.journeyapps.barcodescanner.camera.CameraInstance.validateOpen (CameraInstance.java:181) |
Hey I also had this issue on Huawei P9 running Android 7.0.
|
I also had this issue on iBall running Android 5.1 Please suggest a way to resolve this issue. Thank You!! |
@rkistner here is a a non-obfuscated stack trace, which is also similar to some users who commented above: java.lang.IllegalStateException: CameraInstance is not open |
Faced a similar problem. Maybe someone already found a solution to this problem? Device: HUAWEI P8 Lite, Android 6.0 |
@antileks Which version of the library are you using? |
I use this: |
I recommend upgrading to the latest version in that case - quite a few fixes has been made since then, which may affect this issues as well. |
@rkistner Thank you! |
Description of the problem:
Encountered a crash on using your library. Crash log is as follows:
IllegalStateException: CameraInstance is not open
Module "com.journeyapps.barcodescanner.v", line 38, in handleMessage
Module "com.journeyapps.barcodescanner.u", line 22, in a
Module "com.journeyapps.barcodescanner.u", line 162, in b
Module "com.journeyapps.barcodescanner.u", line 118, in c
Module "com.journeyapps.barcodescanner.a.e", line 143, in a
Apologies as our code is obfuscated but the app occured on your library
Which library version are you using? E.g. 3.2.0.
3.1.0
Which phone/tablet are you using, and which Android version does it run? (e.g. Samsung Galaxy S5,
Android 5.0)
Does the same happen on other devices or an emulator?
Can you reproduce the issue in the sample project included with the library? If not, can you
provide your own sample project or sample code that produces this error?
In the case of an error do you have a stack trace or adb logs?
Encountered a crash on using your library. Crash log is as follows:
IllegalStateException: CameraInstance is not open
Module "com.journeyapps.barcodescanner.v", line 38, in handleMessage
Module "com.journeyapps.barcodescanner.u", line 22, in a
Module "com.journeyapps.barcodescanner.u", line 162, in b
Module "com.journeyapps.barcodescanner.u", line 118, in c
Module "com.journeyapps.barcodescanner.a.e", line 143, in a
The text was updated successfully, but these errors were encountered: