我在使用zxing QRcode扫描仪时遇到问题。
我使用的版本是me.dm7.barcodescanner:zbar:1.9
。
我在控制台中收到以下错误:
E/CameraPreview: java.lang.RuntimeException: cancelAutoFocus failed
java.lang.RuntimeException: cancelAutoFocus failed
at android.hardware.Camera.native_cancelAutoFocus(Native Method)
at android.hardware.Camera.cancelAutoFocus(Camera.java:1302)
at me.dm7.barcodescanner.core.CameraPreview.stopCameraPreview(CameraPreview.java:115)
at me.dm7.barcodescanner.core.CameraPreview.surfaceDestroyed(CameraPreview.java:74)
at android.view.SurfaceView.updateWindow(SurfaceView.java:566)
at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:239)
at android.view.View.dispatchDetachedFromWindow(View.java:14567)
at android.view.ViewGroup.removeAllViewsInLayout(ViewGroup.java:4792)
at android.view.ViewGroup.removeAllViews(ViewGroup.java:4738)
at me.dm7.barcodescanner.core.BarcodeScannerView.setupLayout(BarcodeScannerView.java:43)
at me.dm7.barcodescanner.core.BarcodeScannerView.setupCameraPreview(BarcodeScannerView.java:87)
at me.dm7.barcodescanner.core.CameraHandlerThread$1$1.run(CameraHandlerThread.java:31)
at android.os.Handler.handleCallback(Handler.java:746)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)