-1

Task :cca-app:kaptGenerateStubsDebugKotlin Could not perform incremental compilation: Could not connect to Kotlin compile daemon Could not connect to kotlin daemon. Using fallback strategy. exception: java.io.UTFDataFormatException at java.base/java.io.ObjectInputStream$BlockDataInputStream.readUTFSpan(ObjectInputStream.java:3752) at java.base/java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(ObjectInputStream.java:3677) at java.base/java.io.ObjectInputStream$BlockDataInputStream.readUTF(ObjectInputStream.java:3477) at java.base/java.io.ObjectInputStream.readUTF(ObjectInputStream.java:1240) at org.jetbrains.kotlin.utils.PluginUtilsKt.decodePluginOptions(pluginUtils.kt:39) at org.jetbrains.kotlin.kapt3.Kapt3CommandLineProcessor.processOption(Kapt3Plugin.kt:73) at org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParserKt.processCompilerPluginsOptions(PluginCliParser.kt:125) at org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser.processPluginOptions(PluginCliParser.kt:83) at org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser.loadPlugins(PluginCliParser.kt:72) at org.jetbrains.kotlin.cli.jvm.plugins.PluginCliParser.loadPluginsSafe(PluginCliParser.kt:44) at org.jetbrains.kotlin.cli.common.CLICompiler.loadPlugins(CLICompiler.kt:179) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:69) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88) at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:76) at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:45) at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit(CLITool.kt:227) at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMainNoExit$default(CLITool.kt:222) at org.jetbrains.kotlin.cli.common.CLITool$Companion.doMain(CLITool.kt:214) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler$Companion.main(K2JVMCompiler.kt:271) at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.main(K2JVMCompiler.kt)

Task :cca-app:kaptGenerateStubsDebugKotlin FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':cca-app:kaptGenerateStubsDebugKotlin'.

Compilation error. See log for more details

  • Try: Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 5s 27 actionable tasks: 2 executed, 25 up-to-date


Compose is 1.0.4, Kotlin Gradle plugin is 1.6.0-M1, Gradle build tools is 4.2.2


When I remove the compose dependencies, the project is successfully assembled I tried to change the compose and kotlin versions, but it did not give any result

2 Answers2

4

You're using the wrong version of Kotlin and the Gradle plugin. Use:

Kotlin: 1.5.31 
Gradle plugin: 7.0.3

You should upgrade your Android Studio to the latest version. It provides better notifications about dependency versions and lets you upgrade your dependencies much better than in older versions of Android Studio.

Johann
  • 27,536
  • 39
  • 165
  • 279
  • thank you, I installed android studio and everything worked, let's hope that someday there will be compatibility of the android plug-in for intellij idea with gradle versions older than 7.0 Аlso indicated: kotlinOptions { jvmTarget = JavaVersion.VERSION_1_8 useIR = true freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"]} – SoDa-Salie Oct 19 '21 at 16:04
0

1.6.0-M1 is your problem. Compose is closely tied to the Kotlin compiler, and version 1.0.4 will work with Kotlin 1.5.21.

ditn
  • 1,386
  • 1
  • 10
  • 23
  • Oh, another trouble: Execution failed for task ':cca-app:compileDebugKotlin'. > A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction exception: java.lang.IncompatibleClassChangeError: Found class org.jetbrains.kotlin.ir.declarations.IrClass, but interface was expected – SoDa-Salie Oct 18 '21 at 16:15
  • Sorry I have to correct my answer - using Kotlin `1.5.21` should solve your problem. – ditn Oct 18 '21 at 16:20
  • it didn't help( – SoDa-Salie Oct 18 '21 at 17:25