With the code provided in Kotlin documentation, I'm getting the following error when implementing a TextField:
val state = rememberTextFieldState("Initial text", TextRange(0, 12))
TextField(
state = state,
lineLimits = TextFieldLineLimits.SingleLine,
label = { Text("Label") },
)
None of the following candidates is applicable:
fun TextField(value: TextFieldValue, onValueChange: (TextFieldValue) -> Unit, modifier: Modifier = ..., enabled: Boolean = ..., readOnly: Boolean = ..., textStyle: TextStyle = ..., label: @Composable() (() -> Unit)? = ..., placeholder: @Composable() (() -> Unit)? = ..., leadingIcon: @Composable() (() -> Unit)? = ..., trailingIcon: @Composable() (() -> Unit)? = ..., prefix: @Composable() (() -> Unit)? = ..., suffix: @Composable() (() -> Unit)? = ..., supportingText: @Composable() (() -> Unit)? = ..., isError: Boolean = ..., visualTransformation: VisualTransformation = ..., keyboardOptions: KeyboardOptions = ..., keyboardActions: KeyboardActions = ..., singleLine: Boolean = ..., maxLines: Int = ..., minLines: Int = ..., interactionSource: MutableInteractionSource? = ..., shape: Shape = ..., colors: TextFieldColors = ...): Unit
fun TextField(value: String, onValueChange: (String) -> Unit, modifier: Modifier = ..., enabled: Boolean = ..., readOnly: Boolean = ..., textStyle: TextStyle = ..., label: @Composable() (() -> Unit)? = ..., placeholder: @Composable() (() -> Unit)? = ..., leadingIcon: @Composable() (() -> Unit)? = ..., trailingIcon: @Composable() (() -> Unit)? = ..., prefix: @Composable() (() -> Unit)? = ..., suffix: @Composable() (() -> Unit)? = ..., supportingText: @Composable() (() -> Unit)? = ..., isError: Boolean = ..., visualTransformation: VisualTransformation = ..., keyboardOptions: KeyboardOptions = ..., keyboardActions: KeyboardActions = ..., singleLine: Boolean = ..., maxLines: Int = ..., minLines: Int = ..., interactionSource: MutableInteractionSource? = ..., shape: Shape = ..., colors: TextFieldColors = ...): Unit
material3library are you using? You appear to be trying to use a function signature which appears to have been added in1.4.0-alpha15.stateorlinelimitsfields for TextFieldimplementation(libs.androidx.compose.material3)