edufolly / flutter_mobile_vision

Flutter implementation of Google Mobile Vision.
MIT License
455 stars 168 forks source link

Fail to connect to camera service #26

Closed sleith closed 5 years ago

sleith commented 5 years ago

Hi, I use version 0.1.3. One of my user got crashed, please find a log below:

Fatal Exception: java.lang.RuntimeException: Fail to connect to camera service at android.hardware.Camera.(Camera.java:542) at android.hardware.Camera.open(Camera.java:378) at io.github.edufolly.fluttermobilevision.ui.CameraSource.createCamera(Unknown Source) at io.github.edufolly.fluttermobilevision.ui.CameraSource.release(Unknown Source) at io.github.edufolly.fluttermobilevision.ui.CameraSourcePreview.startIfReady(Unknown Source) at io.github.edufolly.fluttermobilevision.ui.CameraSourcePreview.start(Unknown Source) at io.github.edufolly.fluttermobilevision.ui.CameraSourcePreview$SurfaceCallback.surfaceCreated(Unknown Source) at android.view.SurfaceView.updateWindow(SurfaceView.java:580) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:176) at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2144) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1189) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6243) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:773) at android.view.Choreographer.doCallbacks(Choreographer.java:586) at android.view.Choreographer.doFrame(Choreographer.java:556) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:759) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:160) at android.app.ActivityThread.main(ActivityThread.java:5541) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)

My flutter:

[✓] Flutter (Channel beta, v1.0.0, on Mac OS X 10.13.6 17G65, locale en-ID) • Flutter version 1.0.0 at /Users/raymond.rulin/flutter • Framework revision 5391447fae (7 weeks ago), 2018-11-29 19:41:26 -0800 • Engine revision 7375a0f414 • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

I see the report it happened at Oppo A37f with Android version 5.1.1. Other works fine so far. Thank you for your help :)

edufolly commented 5 years ago

Hi @sleith,

I've just published a new demo app. Check it out... Flutter Mobile Vision Start

Please feel free to ask for further help here.