yipianfengye / android-zxingLibrary

几行代码快速集成二维码扫描功能
5k stars 1.04k forks source link

Camera is being used after Camera.release() was called #239

Open appsming opened 5 years ago

appsming commented 5 years ago

Process: com.kyexpress.platenumberdemo, PID: 15045 java.lang.RuntimeException: Camera is being used after Camera.release() was called at android.hardware.Camera._stopPreview(Native Method) at android.hardware.Camera.stopPreview(Camera.java:813) at com.kyexpress.kyscaner.activity.CaptureFragment.surfaceDestroyed(CaptureFragment.java:185) at android.view.SurfaceView.updateWindow(SurfaceView.java:622) at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:264) at android.view.View.dispatchWindowVisibilityChanged(View.java:10347) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1289) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1289) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1289) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1289) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1289) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1289) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1289) at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1289) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1674) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1372) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6782) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:933) at android.view.Choreographer.doCallbacks(Choreographer.java:742) at android.view.Choreographer.doFrame(Choreographer.java:674) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:919) at android.os.Handler.handleCallback(Handler.java:761) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:156) at android.app.ActivityThread.main(ActivityThread.java:6623) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

licoba commented 5 years ago

是因为自定义CustomViewfinderView了吗?

zaxcler commented 5 years ago

这个问题解决了嘛,我也遇到这个问题了

1Patience-and-1careful commented 4 years ago

同样遇到了

Sola1 commented 4 years ago

扫描成功后想再次打开扫描页面就会报这个错