我一直在犯错误
未绑定到有效相机
当尝试实现imagecapture用例时。在这里,我将按照camerax教程用java实现这个特性。
预览用例绑定正确,我可以在启动活动时访问相机,但当我点击“拍照”按钮时,会出现以下错误:
Photo capture failed: ${exception.message}
androidx.camera.core.ImageCaptureException: Not bound to a valid Camera [ImageCapture:androidx.camera.core.ImageCapture-9aad1b57-8fb6-4a6e-b528-9347343369b6]
at androidx.camera.core.ImageCapture.lambda$sendImageCaptureRequest$6$ImageCapture(ImageCapture.java:825)
at androidx.camera.core.-$$Lambda$ImageCapture$2B91NcXQyr59NDscigcxsZb94mc.run(Unknown Source:4)
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:7656)
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:947)
有人面临类似的问题吗?有什么建议吗?
1条答案
按热度按时间mspsb9vt1#