I found out that this error is actually a problem with IDE or project structure (I'm not really sure). I found out that the ResolutionStrategy constructor is only available in Java Classes, so I can use it like this:
public class CameraUtils {
public static ResolutionStrategy createStrategy(Size deviceSize) {
return new ResolutionStrategy(deviceSize, ResolutionStrategy.FALLBACK_RULE_CLOSEST_HIGHER_THEN_LOWER);
}
public static ResolutionSelector createSelector(Size deviceSize) {
return new ResolutionSelector.Builder().setResolutionStrategy(createStrategy(deviceSize)).build();
}
}
And then call the helper class from my Kotlin code:
val camera = LifecycleCameraController(this)
camera.imageAnalysisBackpressureStrategy = ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST
camera.imageAnalysisResolutionSelector = CameraUtils.createSelector(Size(width, height))