Closed w2016561536 closed 2 years ago
redmi note 8 miui12.0.3版本上,启动相机提示无法连接相机,尝试解决失败,大佬有时间帮忙看下 ,报错信息:
E/CAM_MiCamera2: Failed to resume preview, IllegalState
java.lang.IllegalArgumentException: CaptureRequest contains unconfigured Input/Output Surface! at android.hardware.camera2.CaptureRequest.convertSurfaceToStreamId(CaptureRequest.java:738) at android.hardware.camera2.impl.CameraDeviceImpl.submitCaptureRequest(CameraDeviceImpl.java:1079) at android.hardware.camera2.impl.CameraDeviceImpl.setRepeatingRequest(CameraDeviceImpl.java:1127) at android.hardware.camera2.impl.CameraCaptureSessionImpl.setRepeatingRequest(CameraCaptureSessionImpl.java:298) at com.android.camera2.MiCamera2.resumePreview(MiCamera2.java:22) at com.android.camera.module.BaseModule.accept(BaseModule.java:10) at com.android.camera.module.BaseModule.accept(BaseModule.java:1) at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:2) at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:8) at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:3) at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:2) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:1) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919)
E/CAM_CameraErrorCallback: onCameraError: other error 256
不接受系统相机bug反馈,抱歉。 CameraX库还没有好的解决方案,会报错存在未配置的Surface
有问题请新开issues 不受理系统相机问题
CameraX库在安卓9.0上,由于自动选取最新API,导致配置时相机没有被HOOK到,将“尝试”在下个版本修复。(改了不是一点东西)
也包括完全按照谷歌规定,使用Camera2的库,但使用最新API的应用程序,导致报告打开相机失败的情况。