Hello folks. I'm creating an app with Jetpack Comp...
# compose
Hello folks. I'm creating an app with Jetpack Compose and I want to use CameraX on my app. I need preview and videocapture. And beside them, I need beauty mode option also. For doing that, I should use vendor extensions. According to Android Studio's documentation, I should use vendor extensions. But there is no example for it or maybe I can't find. I wrote something like this but it does not work:
Copy code
fun bindPreview(
    lifecycleOwner: LifecycleOwner,
    previewView: PreviewView,
    cameraProvider: ProcessCameraProvider,
    currentCam: Int,
) {
    val metrics = DisplayMetrics().also { previewView.display.getRealMetrics(it) }
    val screenAspectRatio = aspectRatio(metrics.widthPixels, metrics.heightPixels)
    val rotation = previewView.display.rotation

    val builder = Preview.Builder()

    val preview: Preview = builder
        .build().also {

    val lensFacing = CameraSelector.LENS_FACING_FRONT
    val cameraSelector: CameraSelector = CameraSelector.Builder().requireLensFacing(lensFacing).build()

    val beautyPreviewExtender = BeautyPreviewExtender.create(builder)
    if(beautyPreviewExtender.isExtensionAvailable(cameraSelector)) {
    try {
        val camera = cameraProvider.bindToLifecycle(lifecycleOwner, cameraSelector, preview)
    } catch (exception: Exception) {
        Log.e(TAG, "Use case binding failed.", exception)
bindPreview is called by "AndroidView" in a Composable method. Camera works perfect, but beauty mode is not working. Does anybody know about it ?