```> Task :myModule:kspKotlin__COMPOSE_PREVIEW__ F...
# compose
m
Copy code
> Task :myModule:kspKotlin__COMPOSE_PREVIEW__ FAILED
e: [ksp] java.lang.IllegalStateException: only classes can have super classes, not INTERFACE-->
getting this when I try to load preview in Fleet. I don’t know if this is Fleet’s issue but it doesn’t seem that it is.
w
Hi Marko! Thanks for reporting this issue! TLDR; You can workaround this bug by adding a desktop target or trying to remove the expect type that is breaking our preview KSP. This issue occurs because: • You are running common previews in a project that does not have a desktop target • And you declared an expect type that we do not handle properly (we generate stubs for your expect types). Could you please be so kind to share your Fleet version and the expect type that reproduces this error? Most likely you are using expect enum classes or annotation classes. This is in the works and will most likely be solved in one of the upcoming versions!
m
thank you so much. I’ll try the workaround
Fleet version: 1.37.84 Public Preview
I will dig through the stacktrace to find actual type that’s causing the issue and post it here
can’t find actual problem. what am I missing?
Copy code
e: [ksp] java.lang.IllegalStateException: only classes can have super classes, not INTERFACE--> 8% EXECUTING [3
        at com.squareup.kotlinpoet.TypeSpec$Builder.checkCanHaveSuperclass(TypeSpec.kt:556)
        at com.squareup.kotlinpoet.TypeSpec$Builder.superclass(TypeSpec.kt:550)
        at org.jetbrains.gradle.compose.multiplatform.preview.ksp.ActualStubProcessor.getActualClass(ActualStubProcessor.kt:81)
        at org.jetbrains.gradle.compose.multiplatform.preview.ksp.ActualStubProcessor.access$getActualClass(ActualStubProcessor.kt:19)
        at org.jetbrains.gradle.compose.multiplatform.preview.ksp.ActualStubProcessor$process$1.visitClassDeclaration(ActualStubProcessor.kt:33)
        at org.jetbrains.gradle.compose.multiplatform.preview.ksp.ActualStubProcessor$process$1.visitClassDeclaration(ActualStubProcessor.kt:31)
        at com.google.devtools.ksp.symbol.impl.kotlin.KSClassDeclarationImpl.accept(KSClassDeclarationImpl.kt:135)
        at org.jetbrains.gradle.compose.multiplatform.preview.ksp.ActualStubProcessor.process(ActualStubProcessor.kt:31)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:306)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:304)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:410)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:304)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:112)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:77)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:256)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:247)
        at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:247)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:87)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:43)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:165)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:50)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:104)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:48)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1523)
        at jdk.internal.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
        at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
        at java.base/java.security.AccessController.doPrivileged(Unknown Source)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
w
The stacktrace won't help here sadly. You'd have to manually find which expect type is causing this by removing it and seeing if the preview output still reports the error.
Its most likely that it's an expect annotation class
m
I see. I’ll check what is causing the issue. there aren’t many expect/actual declarations so it shouldn’t be hard, but no expect annotation classes tho
thank you color 1