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

java.lang.RuntimeException: takePicture failed #60

Open
TopGgg opened this issue Mar 2, 2022 · 4 comments
Open

java.lang.RuntimeException: takePicture failed #60

TopGgg opened this issue Mar 2, 2022 · 4 comments

Comments

@TopGgg
Copy link

TopGgg commented Mar 2, 2022

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.exampleapp, PID: 10608
    java.lang.RuntimeException: takePicture failed
        at android.hardware.Camera.native_takePicture(Native Method)
        at android.hardware.Camera.takePicture(Camera.java:1865)
        at android.hardware.Camera.takePicture(Camera.java:1806)
        at com.androidhiddencamera.CameraPreview.takePictureInternal(CameraPreview.java:196)
        at com.androidhiddencamera.HiddenCameraActivity.takePicture(HiddenCameraActivity.java:92)
        at com.example.exampleapp.MainActivity.lambda$onCreate$3$MainActivity(MainActivity.java:152)
        at com.example.exampleapp.MainActivity$$ExternalSyntheticLambda4.run(Unknown Source:2)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7888)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:981)

when the application instance taking picture the first time it works fine, but in the second time it throws me this error.
I'm using LGE LM-K520 device android 11.
this is the code:
findViewById(R.id.pic).setOnClickListener((a) -> takePicture());

Thank You!!!

@kushalshah-invx
Copy link

Hey @TopGgg ,
I am facing the same issue. Have you find the solution of it?
Please help.

@TopGgg
Copy link
Author

TopGgg commented Jun 27, 2022

No, i haven't.
I just replaced the library with direct call to CameraX...

@arghamza
Copy link

Hey @TopGgg can we talk somewhere about the CameraX transition ?

@TopGgg
Copy link
Author

TopGgg commented Jul 18, 2022

Sure,
Message me on discord(TopG#5557).

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

No branches or pull requests

3 participants