user16239068
user16239068

Reputation: 11

Error When Using Android CaptureRequest.CONTROL_ZOOM_RATIO

I just updated my project to Androidx and upgraded to SDK version 30, but when I want to adjust my zoom value I got

java.lang.NoSuchFieldError: No static field CONTROL_ZOOM_RATIO of type Landroid/hardware/camera2/CaptureRequest$Key; in class Landroid/hardware/camera2/CaptureRequest; or its superclasses (declaration of 'android.hardware.camera2.CaptureRequest' appears in /system/framework/framework.jar)

The code that went wrong is:

builder.set(CaptureRequest.CONTROL_ZOOM_RATIO,newZoom);

Upvotes: 1

Views: 803

Answers (1)

Scott Nien
Scott Nien

Reputation: 51

CONTROL_ZOOM_RATIO is supported starting from API level 30. Did you run you app on the device that has API level 30 or higher ?

Upvotes: 1

Related Questions