Skip to content
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 - a.k - Critical exception reported by Firebug #37

Closed
jeffersonlicet opened this issue Jun 9, 2017 · 7 comments
Closed
Assignees
Labels

Comments

@jeffersonlicet
Copy link

 Exception java.lang.IllegalStateException: Preview stream is null. Make sure camera is opened.
io.fotoapparat.a.d.a.k ()
io.fotoapparat.a.d.a.h ()
io.fotoapparat.h.c.run ()
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587)
java.lang.Thread.run (Thread.java:818)

The device : BLU STUDIO C 5+5
Android OS: 5.0

@Diolor
Copy link
Member

Diolor commented Jun 9, 2017

Hi @jeffersonlicet thanks for reporting this! Few questions:

  1. How do you call FA's start/stop ?
  2. Did you try reproduce to it? Would be very helpful if you provide us with the logs from our logger.

Thanks!

@jeffersonlicet
Copy link
Author

jeffersonlicet commented Jun 9, 2017

Thanks four your time.
I start/stop FA using a FotoapparatSwitcher located in this static OpenCV code:

private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {
        @Override
        public void onManagerConnected(int status) {
            switch (status) {
case LoaderCallbackInterface.SUCCESS: 
fotoapparatSwitcher.start();
break;}
        }
    };

OpenCV starts here:

@Override
    public void onResume() {
        super.onResume();

        try {
            if (!OpenCVLoader.initDebug()) {
                OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_2_0, this, mLoaderCallback);
            } else mLoaderCallback.onManagerConnected(LoaderCallbackInterface.SUCCESS);
        } catch (Exception ex) {
            FirebaseCrash.report(ex);
        }
    }

I can't reproduce it, but i will try, i think its related to the Blu phone.

@dmitry-zaitsev
Copy link
Member

Is mLoaderCallback always called from the main thread?

@jeffersonlicet
Copy link
Author

Yes, any clue?

@dmitry-zaitsev
Copy link
Member

Hm, not yet. If mLoaderCallback would be called from background thread that would explain the issue. I suspect that you can reproduce this issue by quickly switching between cameras while OpenCV is being initialized.

Would it be possible for you to provide us with logcat? Make sure you pass logger parameter while creating Fotoapparat.

@dmitry-zaitsev dmitry-zaitsev self-assigned this Jun 11, 2017
@dmitry-zaitsev
Copy link
Member

I am closing this issue until there is more information available. As soon as we'll have logs I will reopen it.

@jeffersonlicet
Copy link
Author

Thank you very much. Solved starting the camera in the main thread as you told me. <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants