Hi,
here is the log with stack trace:
I/CameraManagerGlobal: Camera 21 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client android.system API Level 2
Camera 23 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client android.system API Level 2
Camera 3 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for client com.samsung.android.smartface API Level 2
I/CameraManagerGlobal: Camera 4 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client android.system API Level 2
I/CameraManagerGlobal: Camera 40 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client android.system API Level 2
Camera 50 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client android.system API Level 2
Camera 52 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client android.system API Level 2
Camera 80 facing CAMERA_FACING_BACK state now CAMERA_STATE_CLOSED for client android.system API Level 2
Camera 91 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for client android.system API Level 2
E/MediaProfiles: The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
The given camcorder profile camera 4 quality 1 is not found
W/CameraX: Retry init. Start time 152689353 current time 152689366
java.lang.RuntimeException: Error retrieving camcorder profile params
at android.media.CamcorderProfile.native_get_camcorder_profile(Native Method)
at android.media.CamcorderProfile.get(CamcorderProfile.java:456)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.lambda$E2rRrx9ASsJbpKoXo9ov4Zv64wI(Unknown Source:0)
at androidx.camera.camera2.internal.-$$Lambda$Camera2DeviceSurfaceManager$E2rRrx9ASsJbpKoXo9ov4Zv64wI.get(Unknown Source:0)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getRecordSize(SupportedSurfaceCombination.java:1213)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.generateSurfaceSizeDefinition(SupportedSurfaceCombination.java:1168)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.<init>(SupportedSurfaceCombination.java:120)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.init(Camera2DeviceSurfaceManager.java:94)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:82)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:65)
at androidx.camera.camera2.Camera2Config.lambda$defaultConfig$0(Camera2Config.java:52)
at androidx.camera.camera2.-$$Lambda$Camera2Config$kPfcZYYQs2fXKvw1cjC5GhRy6hM.newInstance(Unknown Source:0)
at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$9$CameraX(CameraX.java:578)
at androidx.camera.core.-$$Lambda$CameraX$u-Xx2b6YXY5GXNXRh-mDiDnHdpQ.run(Unknown Source:10)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
then the same because camera retries couple of times,
then at the end:
Caused by: java.lang.RuntimeException: Error retrieving camcorder profile params
at android.media.CamcorderProfile.native_get_camcorder_profile(Native Method)
at android.media.CamcorderProfile.get(CamcorderProfile.java:456)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.lambda$E2rRrx9ASsJbpKoXo9ov4Zv64wI(Unknown Source:0)
at androidx.camera.camera2.internal.-$$Lambda$Camera2DeviceSurfaceManager$E2rRrx9ASsJbpKoXo9ov4Zv64wI.get(Unknown Source:0)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getRecordSize(SupportedSurfaceCombination.java:1213)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.generateSurfaceSizeDefinition(SupportedSurfaceCombination.java:1168)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.<init>(SupportedSurfaceCombination.java:120)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.init(Camera2DeviceSurfaceManager.java:94)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:82)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.<init>(Camera2DeviceSurfaceManager.java:65)
at androidx.camera.camera2.Camera2Config.lambda$defaultConfig$0(Camera2Config.java:52)
at androidx.camera.camera2.-$$Lambda$Camera2Config$kPfcZYYQs2fXKvw1cjC5GhRy6hM.newInstance(Unknown Source:0)
at androidx.camera.core.CameraX.lambda$initAndRetryRecursively$9$CameraX(CameraX.java:578)
at androidx.camera.core.-$$Lambda$CameraX$u-Xx2b6YXY5GXNXRh-mDiDnHdpQ.run(Unknown Source:10)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
The code where I get this error is:
cameraController = new LifecycleCameraController(context);
Futures.addCallback(cameraController.getInitializationFuture(), new FutureCallback<Void>() {
@Override
public void onSuccess(@Nullable Void result) {
Log.d(TAG, "createCameraController SUCCESS");
onCameraInited.accept(easyCamera);
}
@Override
public void onFailure(Throwable t) {
onFailure.accept(new EasyCameraException("Exception while creating CameraController", t));
}
}, CameraXExecutors.mainThreadExecutor());
There is nothing before this, I mean no camera related code.
Setting the parameters, the use cases, lifecycle binding and everything else are AFTER this code so it does not matter what configuration I plan to use. (Otherwise, YES, I use the video, but I think it has nothing to do with this error. Creating the CameraController is the first step using the camera.)
The exact same code works perfectly with rc02.
The phone is a Samsung Note 10 plus, Android 11.
My gradle files looks like:
def camerax_version = '1.0.0-rc03'
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
implementation "androidx.camera:camera-extensions:1.0.0-alpha22"
implementation 'androidx.camera:camera-view:1.0.0-alpha22'
Cheers,
Peter