Cameraview: Camera.open: Fail to connect to camera service

Created on 30 Mar 2018  ·  32Comments  ·  Source: natario1/CameraView

Cameraview's version:compile 'com.otaliastudios:cameraview:1.5.0'

Tested system's version: 5.1、5.1.1、6.0.1、7.0
BUG's Mobile model:
OPPO A57、A37m
ViVO Xplay5A

Fatal Exception: java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:570)
at android.hardware.Camera.open(Camera.java:384)
at com.otaliastudios.cameraview.Camera1.onStart(Camera1.java:172)
at com.otaliastudios.cameraview.CameraController$3.run(CameraController.java:180)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:179)
at android.os.HandlerThread.run(HandlerThread.java:61)

bug investigation

Most helpful comment

image

All 32 comments

Thanks for the report. Any more info to share?

  • steps to reproduce
  • when does this happen
  • logs. Looks like you can reproduce this, so please add cameraview logs from logcat

I have the same error on Meizu MX6 (Android 6.0) when i want to open the front camera in my activity.
All permissions are granted.

Fatal Exception: java.lang.RuntimeException
Fail to connect to camera service
android.hardware.Camera.<init> (Camera.java:669)
android.hardware.Camera.open (Camera.java:500)
com.otaliastudios.cameraview.Camera1.onStart (Camera1.java:170)
com.otaliastudios.cameraview.CameraController$3.run (CameraController.java:178)
android.os.Handler.handleCallback (Handler.java:815)
android.os.Handler.dispatchMessage (Handler.java:104)
android.os.Looper.loop (Looper.java:207)
android.os.HandlerThread.run (HandlerThread.java:61)

@natario1 have you solved it?
it appears on nexus-4 5.1.1 too

@natario1 Same issue on Motorola Moto X (1st Gen) (ghost), 2048MB RAM, Android 5.1

java.lang.RuntimeException: 
  at android.hardware.Camera.<init> (Camera.java:528)
  at android.hardware.Camera.open (Camera.java:369)
  at com.otaliastudios.cameraview.c.c (Camera1.java:168)
  at com.otaliastudios.cameraview.d$3.run (CameraController.java:175)
  at android.os.Handler.handleCallback (Handler.java:739)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:135)
  at android.os.HandlerThread.run (HandlerThread.java:61)

Any feedback on this issue, my app is currently live and would like to resolve this.

See https://github.com/natario1/CameraView/issues/189#issuecomment-379462951 . Without logs from CameraLogger there is nothing we can do.

@natario1 well I can't ask the user to provide me the log.... And I can't reproduce the issue, I tried.

@chiyan171 @enister @MoustafaElsaghier Can one of you please give more details so the issue can be resolved? I can't reproduce the issue on my device.

@natario1 The issue is not related to front camera because the device that crashed has a front facing camera, but just to make sure I added

if(getApplicationContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)) {
    cameraView.setFacing(Facing.FRONT);
}

I will keep trying to reproduce the issue and let you know if I was successful or not.

Did anyone find the issue? I'm still getting crashes and will have to look at another library if I can't resolve this soon.

I tried reproducing the crash, but failed to do so.

Same issue, and i can get logs from CameraLogger.
image

image

@KORuL same issue here,on samsung j1 ace. if you resolve issue please tell me

@KORuL thank you for the log, can you please post the full log from logcat? It's the only way the owner of this library can fix the issue. Here is what the owner wants - #189 (comment)

2018-08-05 14:56:19.235 1387-1412/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 12739738 , only wrote 12739680
2018-08-05 14:56:19.549 17530-17530/com.some.packet W/art: Verification of void com.blocknotary.interview.InterView.showInterView(android.content.Context, java.lang.String, java.lang.String) took 305.394ms

--------- beginning of system

2018-08-05 14:56:19.621 1714-2140/system_process I/ActivityManager: START u0 {flg=0x10000000 cmp=com.some.packet/com.blocknotary.interview.ActivityMain (has extras)} from uid 10087 on display 0
2018-08-05 14:56:19.631 17530-17535/com.some.packet I/art: Do full code cache collection, code=251KB, data=149KB
2018-08-05 14:56:19.632 17530-17535/com.some.packet I/art: Starting a blocking GC JitCodeCache
2018-08-05 14:56:19.632 17530-17535/com.some.packet I/art: After code cache collection, code=126KB, data=84KB
2018-08-05 14:56:19.661 1714-1842/system_process I/ActivityManager: START u0 {flg=0x10000000 cmp=com.some.packet/com.blocknotary.interview.ActivityMain (has extras)} from uid 10087 on display 0
2018-08-05 14:56:20.001 17530-17530/com.some.packet W/art: Verification of void com.blocknotary.interview.ActivityMain.closeLoading(boolean) took 227.131ms
2018-08-05 14:56:20.164 1714-1732/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{d0f1265 u0 com.some.packet/com.blocknotary.interview.ActivityMain t95}
2018-08-05 14:56:20.259 17530-17530/com.some.packet W/art: Verification of void com.blocknotary.interview.ActivityMain.handleShutter() took 111.822ms
2018-08-05 14:56:20.434 17530-17530/com.some.packet W/art: Verification of void com.blocknotary.interview.ActivityMain.initButtonsListener() took 174.889ms
2018-08-05 14:56:20.631 17530-17530/com.some.packet W/art: Verification of void com.blocknotary.interview.ActivityMain.initText(boolean) took 195.336ms
2018-08-05 14:56:20.719 17530-17537/com.some.packet I/art: Starting a blocking GC Instrumentation
2018-08-05 14:56:20.815 17530-17530/com.some.packet W/art: Verification of void com.blocknotary.interview.ActivityMain.initializeCamera(com.blocknotary.interview.ActivityMain) took 183.741ms
2018-08-05 14:56:21.374 17530-17530/com.some.packet W/art: Verification of void com.blocknotary.interview.ActivityMain.onResume() took 270.894ms
2018-08-05 14:56:21.709 17530-17541/com.some.packet I/art: Background sticky concurrent mark sweep GC freed 33255(2MB) AllocSpace objects, 4(80KB) LOS objects, 7% free, 15MB/16MB, paused 8.299ms total 92.311ms
2018-08-05 14:56:21.800 1714-1728/system_process I/GnssLocationProvider: WakeLock acquired by sendMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest@8d87df4)
2018-08-05 14:56:21.814 17530-17530/com.some.packet D/FFmpeg: Build.CPU_ABI : x86
2018-08-05 14:56:21.814 17530-17530/com.some.packet I/FFmpeg: Loading FFmpeg for x86 CPU
2018-08-05 14:56:21.824 1388-1388/? V/EmulatedCamera_Camera: getCameraInfo
2018-08-05 14:56:21.825 1388-1388/? V/EmulatedCamera_BaseCamera: getCameraInfo
2018-08-05 14:56:21.832 1388-2370/? I/CameraService: CameraService::connect call (PID -1 "com.some.packet", camera ID 0) for HAL version default and Camera API version 1
2018-08-05 14:56:21.979 1714-1731/system_process I/GnssLocationProvider: WakeLock released by handleMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest@8d87df4)
2018-08-05 14:56:22.010 17530-17643/com.some.packet W/art: Verification of void com.github.hiteshsondhi88.libffmpeg.FileUtils.() took 116.158ms
2018-08-05 14:56:22.034 17530-17541/com.some.packet I/art: Background partial concurrent mark sweep GC freed 7927(479KB) AllocSpace objects, 4(80KB) LOS objects, 16% free, 19MB/23MB, paused 5.293ms total 165.316ms
2018-08-05 14:56:22.040 17530-17535/com.some.packet I/art: Do partial code cache collection, code=209KB, data=164KB
2018-08-05 14:56:22.045 17530-17535/com.some.packet I/art: After code cache collection, code=206KB, data=162KB
2018-08-05 14:56:22.046 17530-17535/com.some.packet I/art: Increasing code cache capacity to 1024KB
2018-08-05 14:56:22.046 17530-17535/com.some.packet I/art: JIT allocated 60KB for compiled code of void android.widget.TextView.(android.content.Context, android.util.AttributeSet, int, int)
2018-08-05 14:56:22.477 17530-17530/com.some.packet I/Choreographer: Skipped 168 frames! The application may be doing too much work on its main thread.
2018-08-05 14:56:22.635 1714-3391/system_process I/GnssLocationProvider: WakeLock acquired by sendMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest@ef98560)
2018-08-05 14:56:22.637 17530-17530/com.some.packet D/FFmpeg: Build.CPU_ABI : x86
2018-08-05 14:56:22.637 17530-17530/com.some.packet I/FFmpeg: Loading FFmpeg for x86 CPU
2018-08-05 14:56:22.643 1714-1731/system_process I/GnssLocationProvider: WakeLock released by handleMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest@ef98560)
2018-08-05 14:56:22.726 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:22.852 1387-1413/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 13084838 , only wrote 12913200
2018-08-05 14:56:22.897 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:22.915 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:22.970 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:23.002 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:23.015 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:23.027 1714-1739/system_process I/ActivityManager: Displayed com.some.packet/com.blocknotary.interview.ActivityMain: +2s860ms (total +3s393ms)
2018-08-05 14:56:23.044 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:23.077 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:23.082 17530-17530/com.some.packet W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
2018-08-05 14:56:23.117 17530-17622/com.some.packet D/EGL_emulation: eglMakeCurrent: 0xae3070a0: ver 3 0 (tinfo 0xae303920)
2018-08-05 14:56:24.618 17530-17535/com.some.packet I/art: Do full code cache collection, code=502KB, data=316KB
2018-08-05 14:56:24.620 17530-17535/com.some.packet I/art: Starting a blocking GC JitCodeCache
2018-08-05 14:56:24.620 17530-17535/com.some.packet I/art: After code cache collection, code=426KB, data=254KB
2018-08-05 14:56:24.833 1388-2370/? E/CameraService: CameraService::connect (PID -1) rejected (too many other clients connecting).
2018-08-05 14:56:24.833 17530-17638/com.some.packet W/CameraBase: An error occurred while connecting to camera 0: Service not available
2018-08-05 14:56:24.834 17530-17638/com.some.packet E/CameraController: uncaughtException: Unexpected exception: java.lang.RuntimeException: Fail to connect to camera service
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:496)
at android.hardware.Camera.open(Camera.java:345)
at com.otaliastudios.cameraview.Camera1.onStart(Camera1.java:172)
at com.otaliastudios.cameraview.CameraController$3.run(CameraController.java:180)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
2018-08-05 14:56:27.710 17530-17638/com.some.packet E/CameraController: uncaughtException: Unexpected exception: java.lang.RuntimeException: Fail to connect to camera service
2018-08-05 14:56:28.299 2679-2690/com.google.android.gms.persistent I/art: Background sticky concurrent mark sweep GC freed 7286(471KB) AllocSpace objects, 0(0B) LOS objects, 4% free, 11MB/11MB, paused 24.642ms total 30.067ms
2018-08-05 14:56:28.719 17530-17638/com.some.packet E/CameraController: uncaughtException: Unexpected exception: java.lang.RuntimeException: Fail to connect to camera service
2018-08-05 14:56:29.528 17530-17638/com.some.packet E/CameraController: uncaughtException: Unexpected exception: java.lang.RuntimeException: Fail to connect to camera service
2018-08-05 14:56:30.074 17530-17638/com.some.packet E/CameraController: uncaughtException: Unexpected exception: java.lang.RuntimeException: Fail to connect to camera service
2018-08-05 14:56:30.075 17530-17530/com.some.packet D/AndroidRuntime: Shutting down VM

--------- beginning of crash

2018-08-05 14:56:30.150 17530-17530/com.some.packet E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.some.packet, PID: 17530
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:496)
at android.hardware.Camera.open(Camera.java:345)
at com.otaliastudios.cameraview.Camera1.onStart(Camera1.java:172)
at com.otaliastudios.cameraview.CameraController$3.run(CameraController.java:180)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
2018-08-05 14:56:30.151 1714-2016/system_process W/ActivityManager: Force finishing activity com.some.packet/com.blocknotary.interview.ActivityMain
2018-08-05 14:56:30.215 1714-3113/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
2018-08-05 14:56:30.215 1714-3113/system_process D/OpenGLRenderer: Swap behavior 1
2018-08-05 14:56:30.215 1714-3113/system_process W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2018-08-05 14:56:30.215 1714-3113/system_process D/OpenGLRenderer: Swap behavior 0
2018-08-05 14:56:30.221 1714-3113/system_process D/EGL_emulation: eglCreateContext: 0x9f42ae40: maj 3 min 0 rcv 3
2018-08-05 14:56:30.226 1714-3113/system_process D/EGL_emulation: eglMakeCurrent: 0x9f42ae40: ver 3 0 (tinfo 0x93033a70)
2018-08-05 14:56:30.230 1714-3113/system_process E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
2018-08-05 14:56:30.230 1714-3113/system_process E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
2018-08-05 14:56:30.248 1714-3113/system_process D/EGL_emulation: eglMakeCurrent: 0x9f42ae40: ver 3 0 (tinfo 0x93033a70)
2018-08-05 14:56:30.664 1714-1732/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{f7f5548 u0 com.some.packet/com.blocknotary.interview.ActivityMain t95 f}
2018-08-05 14:56:30.951 17530-17616/com.some.packet I/CrashlyticsCore: Crashlytics report upload complete: 5B66E5D702F4-0001-447A-02DD1808E2A2
2018-08-05 14:56:34.630 2599-17547/com.google.android.googlequicksearchbox:search W/GmsLocationProvider: Error removing location updates: 16
2018-08-05 14:56:40.163 1714-1732/system_process W/ActivityManager: Launch timeout has expired, giving up wake lock!
2018-08-05 14:57:04.976 2599-2599/com.google.android.googlequicksearchbox:search I/GrammarCompilationSvcCt: #startService for null, APP_NAMES.

it is a vm NEXUS 4 API 25

@natario1 please look at the log above.

This VM was worked fine, but i change orientation and this vm start give me this exception

More helpfull

2018-08-05 15:34:42.366 1387-1412/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 12913259 , only wrote 12913200
2018-08-05 15:34:42.478 18137-18144/com.some.packet I/art: Starting a blocking GC Instrumentation
2018-08-05 15:34:42.482 18137-18137/com.some.packet W/art: Verification of void com.some.interview.InterView.showInterView(android.content.Context, java.lang.String, java.lang.String) took 106.140ms

--------- beginning of system

2018-08-05 15:34:42.563 1714-1842/system_process I/ActivityManager: START u0 {flg=0x10000000 cmp=com.some.packet/com.some.interview.ActivityMain (has extras)} from uid 10087 on display 0
2018-08-05 15:34:43.391 18137-18137/com.some.packet W/art: Verification of void com.some.interview.ActivityMain.onResume() took 215.857ms
2018-08-05 15:34:43.649 1714-1728/system_process I/GnssLocationProvider: WakeLock acquired by sendMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest@3bb1996)
2018-08-05 15:34:43.655 18137-18137/com.some.packet D/FFmpeg: Build.CPU_ABI : x86
2018-08-05 15:34:43.655 18137-18137/com.some.packet I/FFmpeg: Loading FFmpeg for x86 CPU
2018-08-05 15:34:43.656 18137-18137/com.some.packet W/WorkerHandler: get: Reusing cached worker handler. CameraViewController
2018-08-05 15:34:43.657 18137-18137/com.some.packet V/WorkerHandler: get: Reusing cached worker handler. CameraViewController
2018-08-05 15:34:43.657 18137-18137/com.some.packet W/WorkerHandler: get: Reusing cached worker handler. CameraViewWorker
2018-08-05 15:34:43.657 18137-18137/com.some.packet V/WorkerHandler: get: Reusing cached worker handler. CameraViewWorker
2018-08-05 15:34:43.658 18137-18137/com.some.packet W/WorkerHandler: get: Reusing cached worker handler. FrameProcessorsWorker
2018-08-05 15:34:43.658 18137-18137/com.some.packet V/WorkerHandler: get: Reusing cached worker handler. FrameProcessorsWorker
2018-08-05 15:34:43.664 1714-1731/system_process I/GnssLocationProvider: WakeLock released by handleMessage(3, 0, com.android.server.location.GnssLocationProvider$GpsRequest@3bb1996)
2018-08-05 15:34:43.673 18137-18137/com.some.packet I/CameraController: Start: posting runnable. State: STATE_STOPPED
2018-08-05 15:34:43.673 18137-18137/com.some.packet V/CameraController: Start: posting runnable. State: STATE_STOPPED
2018-08-05 15:34:43.673 18137-18137/com.some.packet V/CameraController: Start: posting runnable. State: STATE_STOPPED
2018-08-05 15:34:43.674 18137-18137/com.some.packet I/CameraController: Stop: posting runnable. State: STATE_STOPPED
2018-08-05 15:34:43.674 18137-18137/com.some.packet V/CameraController: Stop: posting runnable. State: STATE_STOPPED
2018-08-05 15:34:43.674 18137-18137/com.some.packet V/CameraController: Stop: posting runnable. State: STATE_STOPPED
2018-08-05 15:34:43.675 18137-18192/com.some.packet I/CameraController: Start: executing. State: STATE_STOPPED
2018-08-05 15:34:43.675 18137-18192/com.some.packet V/CameraController: Start: executing. State: STATE_STOPPED
2018-08-05 15:34:43.675 18137-18192/com.some.packet V/CameraController: Start: executing. State: STATE_STOPPED
2018-08-05 15:34:43.675 18137-18192/com.some.packet I/CameraController: Start: about to call onStart() STATE_STARTING
2018-08-05 15:34:43.675 18137-18192/com.some.packet V/CameraController: Start: about to call onStart() STATE_STARTING
2018-08-05 15:34:43.675 18137-18192/com.some.packet V/CameraController: Start: about to call onStart() STATE_STARTING
2018-08-05 15:34:43.675 1388-1388/? V/EmulatedCamera_Camera: getCameraInfo
2018-08-05 15:34:43.675 1388-1388/? V/EmulatedCamera_BaseCamera: getCameraInfo
2018-08-05 15:34:43.676 18137-18137/com.some.packet I/CameraController: Start: posting runnable. State: STATE_STARTING
2018-08-05 15:34:43.676 18137-18137/com.some.packet V/CameraController: Start: posting runnable. State: STATE_STARTING
2018-08-05 15:34:43.676 18137-18137/com.some.packet V/CameraController: Start: posting runnable. State: STATE_STARTING
2018-08-05 15:34:43.681 1388-1388/? V/EmulatedCamera_Camera: getCameraInfo
2018-08-05 15:34:43.682 1388-1388/? V/EmulatedCamera_BaseCamera: getCameraInfo
2018-08-05 15:34:43.682 1388-2370/? I/CameraService: CameraService::connect call (PID -1 "com.some.packet", camera ID 1) for HAL version default and Camera API version 1
2018-08-05 15:34:43.731 18137-18137/com.some.packet I/CameraCallbacks: onDeviceOrientationChanged 0
2018-08-05 15:34:43.732 18137-18137/com.some.packet V/CameraCallbacks: onDeviceOrientationChanged 0
2018-08-05 15:34:43.732 18137-18137/com.some.packet V/CameraCallbacks: onDeviceOrientationChanged 0
2018-08-05 15:34:43.732 18137-18137/com.some.packet I/Choreographer: Skipped 69 frames! The application may be doing too much work on its main thread.
2018-08-05 15:34:43.741 18137-18137/com.some.packet W/CameraView: preview: isHardwareAccelerated: true
2018-08-05 15:34:43.741 18137-18137/com.some.packet V/CameraView: preview: isHardwareAccelerated: true
2018-08-05 15:34:43.741 18137-18137/com.some.packet V/CameraView: preview: isHardwareAccelerated: true
2018-08-05 15:34:43.746 18137-18137/com.some.packet W/CameraView: preview: isHardwareAccelerated: true
2018-08-05 15:34:43.746 18137-18137/com.some.packet V/CameraView: preview: isHardwareAccelerated: true
2018-08-05 15:34:43.746 18137-18137/com.some.packet V/CameraView: preview: isHardwareAccelerated: true
2018-08-05 15:34:43.767 18137-18137/com.some.packet W/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.767 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.767 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.767 18137-18137/com.some.packet W/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.767 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.767 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.775 18137-18137/com.some.packet W/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.775 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.775 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.776 18137-18137/com.some.packet W/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.776 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.776 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.798 18137-18137/com.some.packet W/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.798 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.798 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.798 18137-18137/com.some.packet W/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.798 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.798 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.814 18137-18137/com.some.packet W/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.814 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.814 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.815 18137-18137/com.some.packet W/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.815 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.815 18137-18137/com.some.packet V/CameraView: onMeasure: surface is not ready. Calling default behavior.
2018-08-05 15:34:43.824 18137-18137/com.some.packet I/CameraCallbacks: onDeviceOrientationChanged 0
2018-08-05 15:34:43.824 18137-18137/com.some.packet V/CameraCallbacks: onDeviceOrientationChanged 0
2018-08-05 15:34:43.824 18137-18137/com.some.packet V/CameraCallbacks: onDeviceOrientationChanged 0
2018-08-05 15:34:43.832 18137-18137/com.some.packet I/CameraPreview: onSurfaceAvailable: w= 768 h= 1280
2018-08-05 15:34:43.832 18137-18137/com.some.packet V/CameraPreview: onSurfaceAvailable: w= 768 h= 1280
2018-08-05 15:34:43.832 18137-18137/com.some.packet V/CameraPreview: onSurfaceAvailable: w= 768 h= 1280
2018-08-05 15:34:43.833 18137-18137/com.some.packet I/Camera1: onSurfaceAvailable: Size is 768x1280
2018-08-05 15:34:43.833 18137-18137/com.some.packet V/Camera1: onSurfaceAvailable: Size is 768x1280
2018-08-05 15:34:43.833 18137-18137/com.some.packet V/Camera1: onSurfaceAvailable: Size is 768x1280
2018-08-05 15:34:43.837 18137-18137/com.some.packet I/CameraPreview: onSurfaceAvailable: w= 768 h= 1280
2018-08-05 15:34:43.837 18137-18137/com.some.packet V/CameraPreview: onSurfaceAvailable: w= 768 h= 1280
2018-08-05 15:34:43.837 18137-18137/com.some.packet V/CameraPreview: onSurfaceAvailable: w= 768 h= 1280
2018-08-05 15:34:43.837 18137-18137/com.some.packet I/Camera1: onSurfaceAvailable: Size is 768x1280
2018-08-05 15:34:43.837 18137-18137/com.some.packet V/Camera1: onSurfaceAvailable: Size is 768x1280
2018-08-05 15:34:43.837 18137-18137/com.some.packet V/Camera1: onSurfaceAvailable: Size is 768x1280
2018-08-05 15:34:43.854 18137-18172/com.some.packet D/EGL_emulation: eglMakeCurrent: 0x91ccfd40: ver 3 0 (tinfo 0xa13b7880)
2018-08-05 15:34:43.903 18137-18142/com.some.packet I/art: Do partial code cache collection, code=229KB, data=189KB
2018-08-05 15:34:43.906 18137-18142/com.some.packet I/art: After code cache collection, code=209KB, data=179KB
2018-08-05 15:34:43.906 18137-18142/com.some.packet I/art: Increasing code cache capacity to 1024KB
2018-08-05 15:34:43.907 18137-18142/com.some.packet I/art: JIT allocated 60KB for compiled code of void android.widget.TextView.(android.content.Context, android.util.AttributeSet, int, int)
2018-08-05 15:34:43.929 1714-1739/system_process I/ActivityManager: Displayed com.some.packet/com.some.interview.ActivityMain: +1s357ms
2018-08-05 15:34:43.952 18137-18137/com.some.packet W/IInputConnectionWrapper: finishComposingText on inactive InputConnection
2018-08-05 15:34:45.591 1387-1413/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 13220815 , only wrote 13068000
2018-08-05 15:34:46.684 1388-2370/? E/CameraService: CameraService::connect (PID -1) rejected (too many other clients connecting).
2018-08-05 15:34:46.684 18137-18192/com.some.packet W/CameraBase: An error occurred while connecting to camera 1: Service not available
2018-08-05 15:34:46.685 18137-18192/com.some.packet E/CameraController: uncaughtException: Unexpected exception: java.lang.RuntimeException: Fail to connect to camera service
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:496)
at android.hardware.Camera.open(Camera.java:345)
at com.otaliastudios.cameraview.Camera1.onStart(Camera1.java:172)
at com.otaliastudios.cameraview.CameraController$3.run(CameraController.java:180)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
2018-08-05 15:34:46.685 18137-18192/com.some.packet V/CameraController: uncaughtException: Unexpected exception: java.lang.RuntimeException: Fail to connect to camera service
2018-08-05 15:34:46.685 18137-18192/com.some.packet V/CameraController: uncaughtException: Unexpected exception: java.lang.RuntimeException: Fail to connect to camera service
2018-08-05 15:34:46.685 18137-18192/com.some.packet I/CameraController: destroy: state: STATE_STARTING
2018-08-05 15:34:46.685 18137-18192/com.some.packet V/CameraController: destroy: state: STATE_STARTING
2018-08-05 15:34:46.685 18137-18192/com.some.packet V/CameraController: destroy: state: STATE_STARTING
2018-08-05 15:34:46.686 18137-18192/com.some.packet I/CameraController: stopImmediately: State was: STATE_STARTING
2018-08-05 15:34:46.686 18137-18192/com.some.packet V/CameraController: stopImmediately: State was: STATE_STARTING
2018-08-05 15:34:46.686 18137-18192/com.some.packet V/CameraController: stopImmediately: State was: STATE_STARTING
2018-08-05 15:34:46.686 18137-18192/com.some.packet I/Camera1: onStop: About to clean up.
2018-08-05 15:34:46.686 18137-18192/com.some.packet V/Camera1: onStop: About to clean up.
2018-08-05 15:34:46.686 18137-18192/com.some.packet V/Camera1: onStop: About to clean up.
2018-08-05 15:34:46.686 18137-18192/com.some.packet W/Camera1: onStop: Clean up. Returning.
2018-08-05 15:34:46.686 18137-18192/com.some.packet V/Camera1: onStop: Clean up. Returning.
2018-08-05 15:34:46.687 18137-18192/com.some.packet V/Camera1: onStop: Clean up. Returning.
2018-08-05 15:34:46.687 18137-18192/com.some.packet I/CameraController: stopImmediately: Stopped. State is: STATE_STOPPED
2018-08-05 15:34:46.687 18137-18192/com.some.packet V/CameraController: stopImmediately: Stopped. State is: STATE_STOPPED
2018-08-05 15:34:46.687 18137-18192/com.some.packet V/CameraController: stopImmediately: Stopped. State is: STATE_STOPPED
2018-08-05 15:34:46.699 18137-18137/com.some.packet D/AndroidRuntime: Shutting down VM

--------- beginning of crash

2018-08-05 15:34:46.767 18137-18137/com.some.packet E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.some.packet, PID: 18137
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:496)
at android.hardware.Camera.open(Camera.java:345)
at com.otaliastudios.cameraview.Camera1.onStart(Camera1.java:172)
at com.otaliastudios.cameraview.CameraController$3.run(CameraController.java:180)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.os.HandlerThread.run(HandlerThread.java:61)
2018-08-05 15:34:46.768 1714-3390/system_process W/ActivityManager: Force finishing activity com.some.packet/com.some.interview.ActivityMain
2018-08-05 15:34:46.770 1714-3390/system_process W/ActivityManager: Force finishing activity com.some.packet/.Interview
2018-08-05 15:34:46.821 1714-3113/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
2018-08-05 15:34:46.821 1714-3113/system_process D/OpenGLRenderer: Swap behavior 1
2018-08-05 15:34:46.821 1714-3113/system_process W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2018-08-05 15:34:46.821 1714-3113/system_process D/OpenGLRenderer: Swap behavior 0
2018-08-05 15:34:46.827 1714-3113/system_process D/EGL_emulation: eglCreateContext: 0x9f42ae40: maj 3 min 0 rcv 3
2018-08-05 15:34:46.828 1714-3113/system_process D/EGL_emulation: eglMakeCurrent: 0x9f42ae40: ver 3 0 (tinfo 0x93033a70)
2018-08-05 15:34:46.829 1714-3113/system_process E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
2018-08-05 15:34:46.829 1714-3113/system_process E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
2018-08-05 15:34:46.836 1714-3113/system_process D/EGL_emulation: eglMakeCurrent: 0x9f42ae40: ver 3 0 (tinfo 0x93033a70)
2018-08-05 15:34:47.270 1714-1732/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{a6e1aca u0 com.some.packet/com.some.interview.ActivityMain t96 f}
2018-08-05 15:34:47.321 2599-2791/com.google.android.googlequicksearchbox:search D/EGL_emulation: eglMakeCurrent: 0x9f42ae40: ver 3 0 (tinfo 0x8c6da750)
2018-08-05 15:34:47.388 2599-2599/com.google.android.googlequicksearchbox:search I/OptInState: There is a new client and it does not support opt-in. Dropping request.
2018-08-05 15:34:47.390 2599-18205/com.google.android.googlequicksearchbox:search W/LocationOracle: No location history returned by ContextManager
2018-08-05 15:34:47.397 2599-2599/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: Micro detection mode: [mDetectionMode: [1]].
2018-08-05 15:34:47.397 2599-2599/com.google.android.googlequicksearchbox:search I/AudioController: Using mInputStreamFactoryBuilder
2018-08-05 15:34:47.407 2280-2641/com.google.android.apps.nexuslauncher D/EGL_emulation: eglMakeCurrent: 0xae305420: ver 3 0 (tinfo 0xae303290)
2018-08-05 15:34:47.407 2599-18207/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Starting detection.
2018-08-05 15:34:47.409 2599-18152/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_starting com.google.android.apps.gsa.staticplugins.z.c@d4839
2018-08-05 15:34:47.413 1387-5988/? E/AudioFlinger: not enough memory for AudioTrack size=131296
2018-08-05 15:34:47.413 1387-5988/? D/MemoryDealer: AudioTrack (0xb109ce70, size=4194304)
0: 0xb109ce80 | 0x00000000 | 0x000200E0 | A
1: 0xb109cea0 | 0x000200E0 | 0x000200E0 | A
2: 0xb109cc80 | 0x000401C0 | 0x000200E0 | A
3: 0xb109ce30 | 0x000602A0 | 0x000200E0 | A
4: 0xb0652150 | 0x00080380 | 0x000200E0 | A
5: 0xb0652330 | 0x000A0460 | 0x000200E0 | A
6: 0xb0652500 | 0x000C0540 | 0x000200E0 | A
7: 0xb0652690 | 0x000E0620 | 0x000200E0 | A
8: 0xb0652760 | 0x00100700 | 0x000200E0 | A
9: 0xb0652ab0 | 0x001207E0 | 0x000200E0 | A
10: 0xb0652920 | 0x001408C0 | 0x000200E0 | A
11: 0xb0652620 | 0x001609A0 | 0x000200E0 | A
12: 0xb078c3a0 | 0x00180A80 | 0x000200E0 | A
13: 0xade7d280 | 0x001A0B60 | 0x000200E0 | A
14: 0xade7d2e0 | 0x001C0C40 | 0x000200E0 | A
15: 0xb078c720 | 0x001E0D20 | 0x000200E0 | A
16: 0xb078c960 | 0x00200E00 | 0x000200E0 | A
17: 0xb078c380 | 0x00220EE0 | 0x000200E0 | A
18: 0xb078c910 | 0x00240FC0 | 0x000200E0 | A
19: 0xb078c9e0 | 0x002610A0 | 0x000200E0 | A

2018-08-05 15:34:47.413 1387-5988/? E/AudioFlinger: createRecordTrack_l() initCheck failed -12; no control block?
2018-08-05 15:34:47.413 2599-18152/com.google.android.googlequicksearchbox:search E/AudioRecord: AudioFlinger could not create record track, status: -12
2018-08-05 15:34:47.432 1387-18210/? I/AudioFlinger: AudioFlinger's thread 0xa9f03980 ready to run
2018-08-05 15:34:47.433 2599-18152/com.google.android.googlequicksearchbox:search E/AudioRecord-JNI: Error creating AudioRecord instance: initialization check failed with status -12.
2018-08-05 15:34:47.440 2599-18152/com.google.android.googlequicksearchbox:search E/android.media.AudioRecord: Error code -20 when initializing native AudioRecord object.
2018-08-05 15:34:47.441 2599-18152/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_started com.google.android.apps.gsa.staticplugins.z.c@d4839
2018-08-05 15:34:47.441 2599-18152/com.google.android.googlequicksearchbox:search E/ActivityThread: Failed to find provider info for com.google.android.apps.gsa.testing.ui.audio.recorded
2018-08-05 15:34:47.443 2599-2599/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: onReady
2018-08-05 15:34:47.446 2599-18152/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_close com.google.android.apps.gsa.staticplugins.z.c@d4839
2018-08-05 15:34:47.446 2599-18207/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Detection finished
2018-08-05 15:34:47.446 2599-18207/com.google.android.googlequicksearchbox:search W/ErrorReporter: reportError [type: 211, code: 524300]: Error reading from input stream
2018-08-05 15:34:47.447 2599-4491/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Stopping hotword detection.
2018-08-05 15:34:47.447 2599-18207/com.google.android.googlequicksearchbox:search W/ErrorProcessor: onFatalError, processing error from engine(4)

@KORuL can you reproduce this in the demo app?

The error CameraService::connect (PID -1) rejected (too many other clients connecting). and the fact that all other lines are repeated 3 times, makes me think that you are using more than one CameraView at once which is not possible.

If this is the case I am happy that we do not post this error to the error callback because this is a developer error that you should fix before going in production.

If you can reproduce the error in the demo app, please post all logs from there! Before trying to reproduce, please reboot your device, because this crash with your app might have left the camera in a bad state.

yes, it can be said a developer's bug!
I tested in different modes and found out how to fix this fall:

  1. do not use the CameraView initialization in the code, such as: CameraView mcameraView = CameraView (activity)

use only CameraView mcameraView = findviewbyid (R.id.camera)

  1. After correcting the error in code, restart the device / emulator. And remember - the emulator behavior of the SDK, can differ from the real

@KORuL the fact that you implemented the initialization incorrectly doesn't mean that the rest of us did the same. I'm glad you found your issue and it is working on the emulator.

  • I'm only using one instance of CameraView (I can't think why someone would even try to use more then one).
  • I'm getting this on real devices, not on a emulator (the app is live on Google Play).

As mentioned previously, I can't post a log because I don't have a device to reproduce the issue.

If it is a developer error, like you are saying, then please tell me what I have done that could cause this issue:

public class camView extends Activity{
    CameraView cameraView;
    ImageView startRec, stopRec, flipCam;
    String filename;
    File directoryToStore;
    File filePlusName;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
                WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
        setContentView(R.layout.activity_cam_view);

        cameraView = findViewById(R.id.camera);
        flipCam = findViewById(R.id.flipCam);
        startRec = findViewById(R.id.startRec);
        stopRec = findViewById(R.id.stopRec);

        cameraView.mapGesture(Gesture.PINCH, GestureAction.ZOOM);
        cameraView.mapGesture(Gesture.TAP, GestureAction.FOCUS_WITH_MARKER);
        cameraView.mapGesture(Gesture.LONG_TAP, GestureAction.CAPTURE);

        SimpleDateFormat formatter = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss");
        Date now = new Date();
        filename = formatter.format(now) + ".mp4";

        directoryToStore = getBaseContext().getExternalFilesDir("CameraTemp");

        filePlusName = new File(directoryToStore, filename);

        flipCam.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(getApplicationContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT)) {
                    if (cameraView.getFacing() == Facing.FRONT) {
                        cameraView.setFacing(Facing.BACK);
                    } else {
                        cameraView.setFacing(Facing.FRONT);
                    }
                }else {
                    Toast.makeText(camView.this, "Your device doesn't have a front camera..", Toast.LENGTH_SHORT).show();
                }

            }
        });

        if (startRec.getVisibility() == View.VISIBLE) {
            startRec.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    startRec.setVisibility(View.GONE);
                    stopRec.setVisibility(View.VISIBLE);
                    startCaptureVideo();
                }

            });
        }
        if (startRec.getVisibility() == View.VISIBLE) {
            stopRec.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    stopRec.setVisibility(View.GONE);
                    startRec.setVisibility(View.VISIBLE);
                    stopCaptureVideo();
                }
            });

        }
    }

    private void startCaptureVideo() {
        cameraView.startCapturingVideo(filePlusName);

    }

    private void stopCaptureVideo() {
        cameraView.stopCapturingVideo();
        camListener();
    }

    private void camListener() {
        cameraView.addCameraListener(new CameraListener() {
            @Override
            public void onCameraOpened(CameraOptions options) {

            }

            @Override
            public void onVideoTaken(File video) {
                String path = filePlusName.getAbsolutePath();

                Intent intent = new Intent(camView.this, VideoActivity.class);
                intent.putExtra("videoUri", path);
                intent.setData(FileProvider.getUriForFile(getApplication(),getApplication().getPackageName() + ".provider", video));
                intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

                startActivity(intent);
                finish();

            }

        });

    }

    @Override
    protected void onResume() {
        super.onResume();
        cameraView.start();
    }

    @Override
    protected void onPause() {
        super.onPause();
        cameraView.stop();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        cameraView.destroy();
    }

}

@HBiSoft can you set up logging for your next release? Link your app to something like crashlytics and use CameraLogger.setLogLevel (use verbose to get more logs) and registerLogger to intercept logs and send them to crashlytics.

Then post here all the logs from a session that crashed (from start to crash). You could set up this only for the devices that have this issue (if you know it is device specific) in order not to have useless log entries.

same issue on nubia z17 mini,

With #265 you can now catch this exception in the error handler, instead of having the app crash.

I still think it would have been cool to understand if there is a bug in the library or not - and this will be more difficult with #265 because we'll get less reports. But we were not able to fix this so...

I will close this now. If you get this exception again (after #265 is merged), please open a new issue with CameraLogger logs so we can see if there's something wrong on our side.

This issue occurs when the camera is in a state that is not ready for use, the cause may be that some other application(also maybe your own code) did not release the camera correctly after they used it. For this situation, you should find a solution to recover(not limited in coding way, maybe you need a reboot), and just give an alert to users.

I have similar code as @HBiSoft . I have already wasted two days trying to fix it. If anyone has a solution please let me know.
Thanks.

@alifarina What device are you using and what version of CameraView are you using? Also, when does the crash happen? Mine happened as soon as I start the recording.

Hi
I have OnePlus 6T and I am not using camera view. I am using a camera
intent to open the device default camera. Sometimes it crashes just after
the camera is open and sometimes it crashes after taking a picture.

The error log doesn't say much, just that the process was killed due to low
memory.

On Mon, 23 Sep, 2019, 3:54 PM Hagen Brooks, notifications@github.com
wrote:

@alifarina https://github.com/alifarina What device are you using and
what version of CameraView are you using? Also, when does the crash
happen? Mine happened as soon as I start the recording.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/natario1/CameraView/issues/189?email_source=notifications&email_token=AD32G67QG5PJWBVQSGN2RXTQLCKOFA5CNFSM4EYFIUD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7KNJFQ#issuecomment-534041750,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AD32G64NH6GBBNO4UONC6BDQLCKOFANCNFSM4EYFIUDQ
.

@natario1 Here is the log as you asked for above:

------ exception.getReason() started -----

1

------ exception.getReason() ended ------

------ exception.toString() started ------

com.otaliastudios.cameraview.CameraException: java.lang.RuntimeException: Fail to connect to camera service

------ exception.toString() ended ------

------ exception.getMessage() started ------

java.lang.RuntimeException: Fail to connect to camera service

------ exception.getMessage() ended ------

------ exceptionStackTrace started ------

com.otaliastudios.cameraview.CameraException: java.lang.RuntimeException: Fail to connect to camera service
    at com.otaliastudios.cameraview.engine.Camera1Engine.g(Camera1Engine.java:13)
    at com.otaliastudios.cameraview.engine.CameraEngine$3.call(CameraEngine.java:3)
    at com.otaliastudios.cameraview.engine.CameraEngine$3.call(CameraEngine.java:1)
    at com.otaliastudios.cameraview.engine.Step$2.then(Step.java:4)
    at com.otaliastudios.cameraview.engine.Step$2.then(Step.java:1)
    at com.google.android.gms.tasks.zzf.run(Unknown Source)
    at com.otaliastudios.cameraview.internal.utils.WorkerHandler.run(WorkerHandler.java:2)
    at com.otaliastudios.cameraview.internal.utils.WorkerHandler$1.execute(WorkerHandler.java:1)
    at com.google.android.gms.tasks.zze.onComplete(Unknown Source)
    at com.google.android.gms.tasks.zzr.zza(Unknown Source)
    at com.google.android.gms.tasks.zzu.zze(Unknown Source)
    at com.google.android.gms.tasks.zzu.continueWithTask(Unknown Source)
    at com.otaliastudios.cameraview.engine.Step.a(Step.java:7)
    at com.otaliastudios.cameraview.engine.CameraEngine.startEngine(CameraEngine.java:2)
    at com.otaliastudios.cameraview.engine.CameraEngine.b(CameraEngine.java:1)
    at com.otaliastudios.cameraview.engine.CameraEngine$17$1.call(CameraEngine.java:2)
    at com.otaliastudios.cameraview.engine.CameraEngine$17$1.call(CameraEngine.java:1)
    at com.otaliastudios.cameraview.engine.Step$2.then(Step.java:4)
    at com.otaliastudios.cameraview.engine.Step$2.then(Step.java:1)
    at com.google.android.gms.tasks.zzf.run(Unknown Source)
    at com.otaliastudios.cameraview.internal.utils.WorkerHandler.run(WorkerHandler.java:2)
    at com.otaliastudios.cameraview.internal.utils.WorkerHandler$1.execute(WorkerHandler.java:1)
    at com.google.android.gms.tasks.zze.onComplete(Unknown Source)
    at com.google.android.gms.tasks.zzr.zza(Unknown Source)
    at com.google.android.gms.tasks.zzu.zze(Unknown Source)
    at com.google.android.gms.tasks.zzu.continueWithTask(Unknown Source)
    at com.otaliastudios.cameraview.engine.Step.a(Step.java:7)
    at com.otaliastudios.cameraview.engine.Step.a(Step.java:5)
    at com.otaliastudios.cameraview.engine.CameraEngine$17.run(CameraEngine.java:2)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:157)
    at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: java.lang.RuntimeException: Fail to connect to camera service
    at android.hardware.Camera.native_setup(Native Method)
    at android.hardware.Camera.<init>(Camera.java:420)
    at android.hardware.Camera.open(Camera.java:372)
    at com.otaliastudios.cameraview.engine.Camera1Engine.g(Camera1Engine.java:1)
    ... 32 more


------ exceptionStackTrace ended ------


Was this page helpful?
0 / 5 - 0 ratings