previewRequestBuilder.addTarget(Surface(textureView.surfaceTexture))…
- User
previewRequestBuilder.addTarget(Surface(textureView.surfaceTexture))
codecameraDevice.createCaptureSession(listOf(Surface(textureView.surfaceTexture)), object : CameraCaptureSession.StateCallback() { override fun onConfigured(session: CameraCaptureSession) { cameraCaptureSession = session cameraCaptureSession.setRepeatingRequest(previewRequestBuilder.build(), null, null) }None of the following functions can be called with the arguments supplied. Surface(() → Unit, Modifier = ..., Boolean = ..., Shape = ..., Color = ..., Color = ..., Dp = ..., Dp = ..., BorderStroke? = ..., MutableInteractionSource = ..., () → Unit) defined in androidx.compose.material3 Surface(Modifier = ..., Shape = ..., Color = ..., Color = ..., Dp = ..., Dp = ..., BorderStroke? = ..., () → Unit) defined in androidx.compose.material3 Surface(Boolean, () → Unit, Modifier = ..., Boolean = ..., Shape = ..., Color = ..., Color = ..., Dp = ..., Dp = ..., BorderStroke? = ..., MutableInteractionSource = ..., () → Unit) defined in androidx.compose.material3 Surface(Boolean, (Boolean) → Unit, Modifier = ..., Boolean = ..., Shape = ..., Color = ..., Color = ..., Dp = ..., Dp = ..., BorderStroke? = ..., MutableInteractionSource = ..., () → Unit) defined in androidx.compose.material3
- Assistant
It seems like you have mixed up the
android.view.Surfaceclass withandroidx.compose.material3.SurfaceComposable function. The error message indicates that the compiler is confused between the two because of the import statements in your Kotlin file.