compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Gradle sync issues when previewing simple composable

Open AlexTena opened this issue 3 years ago • 1 comments

OS: Windows 10 IntelliJ IDEA 2022.1.4

`@Composable @Preview fun App() { var text by remember { mutableStateOf("Hello, World!") }

MaterialTheme {
    Button(onClick = {
        text = "Hello, Desktop!"
    }) {
        Text(text)
    }
}

}`

When I want to preview this simple composable I get this error:

Unable to find method 'java.net.URLEncoder.encode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;' java.net.URLEncoder.encode(Ljava/lang/String;Ljava/nio/charset/Charset;)Ljava/lang/String;

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

Re-download dependencies and sync project (requires network) The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart) Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

AlexTena avatar Jul 25 '22 16:07 AlexTena

With the alpha plugin and IntelliJ 2022.2 its working.

Burtan avatar Jul 27 '22 19:07 Burtan