yasea
yasea copied to clipboard
Fail to connect to camera service
I got this error.
App is working on Samsung but that is crashed on another phone.
Caused by java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.
in SrsCameraView class, I see private Camera mCamera; I think that this bug is related with using deprecated Camera sdk. please let me know how can I fix it.
No, that is because your camera does not support preview resolution as 640x360. Try 640x480 in MainActivity.java
I changed resolution as 640x480. but app is still crashed. Phone is Samsung Galaxy Sol, android version is 6.0.1
Please invoke mCamera.getParameters().getSupportedPreviewSizes()
and mCamera.getParameters().getSupportedPictureSizes
to find out what is the proper preview resolution should be set.
Why doesn't this sdk show any permission dialog such as camera access.? I tried with default resolution but app is crashed. it seems that app is crashed because access on camera without any permission.
OK, I resolved this problem. I call Manifest.permission.CAMERA and Manifest.permission.RECORD_AUDIO manually. now it works fine.
OK, I resolved this problem. I call Manifest.permission.CAMERA and Manifest.permission.RECORD_AUDIO manually. now it works fine.
I use the same way to resolve my question.