You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is actually an issue with the library or if I have a version conflict among dependencies in my project.
I see this error when I run my tests:
Exception on loading scripting plugin: java.lang.ClassNotFoundException: org.jetbrains.kotlin.scripting.compiler.plugin.ScriptingCompilerConfigurationComponentRegistrar
v: Scripting plugin will not be loaded: not all required jars are present in the classpath (missing files: [./kotlin-scripting-compiler.jar, ./kotlin-scripting-compiler-impl.jar, ./kotlinx-coroutines-core-jvm.jar, ./kotlin-scripting-common.jar, ./kotlin-scripting-jvm.jar, ./js.engines.jar])
v: Using JVM IR backend
v: Configuring the compilation environment
v: Loading modules: [java.se, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.jartool, jdk.javadoc, jdk.jdi, jdk.jfr, jdk.jsobject, jdk.management, jdk.management.jfr, jdk.net, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.net.http, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.transaction.xa, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.jdwp.agent]
e: java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.incremental.storage.BasicMap.<init>(java.io.File, org.jetbrains.kotlin.com.intellij.util.io.KeyDescriptor, org.jetbrains.kotlin.com.intellij.util.io.DataExternalizer)'
at com.google.devtools.ksp.PersistentMap.<init>(Incremental.kt:56)
at com.google.devtools.ksp.FileToSymbolsMap.<init>(Incremental.kt:62)
at com.google.devtools.ksp.IncrementalContext.<init>(Incremental.kt:189)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$1.invoke(KotlinSymbolProcessingExtension.kt:171)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$1.invoke(KotlinSymbolProcessingExtension.kt:168)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:390)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:168)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:123)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:99)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:257)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:42)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:248)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:88)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:47)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:168)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:53)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:100)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:46)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
at com.tschuchort.compiletesting.AbstractKotlinCompilation.compileKotlin(AbstractKotlinCompilation.kt:254)
at com.tschuchort.compiletesting.KotlinCompilation.compileJvmKotlin(KotlinCompilation.kt:452)
at com.tschuchort.compiletesting.KotlinCompilation.compile(KotlinCompilation.kt:628)
I think it could be because the Kotlin version from the library (1.8.0) is different from the one I am currently using in my project (1.8.20). It seems it works with KAPT, but not with KSP.
I tried updating to 1.9.0 using this fork and it worked. To get the generated files I did this that I saw among the comments in the issues:
private val JvmCompilationResult.kspGeneratedSources: List<File>
get() {
val kspWorkingDir = outputDirectory.parentFile.resolve(KSP_GENERATED_FOLDER)
val kspGeneratedDir = kspWorkingDir.resolve(SOURCES_GENERATED_FOLDER)
val kotlinGeneratedDir = kspGeneratedDir.resolve(KOTLIN_GENERATED_FOLDER)
return kotlinGeneratedDir.listFilesRecursively()
}
private fun File.listFilesRecursively(): List<File> {
return listFiles()?.flatMap { file ->
if (file.isDirectory) {
file.listFilesRecursively()
} else {
listOf(file)
}
} ?: emptyList()
}
// ...
private const val KSP_GENERATED_FOLDER = "ksp"
private const val SOURCES_GENERATED_FOLDER = "sources"
private const val KOTLIN_GENERATED_FOLDER = "kotlin"
Hi! 🙂
Not sure if this is actually an issue with the library or if I have a version conflict among dependencies in my project.
I see this error when I run my tests:
I have this configuration:
Do you now what can be the source of the error?
Could it be because the KSP version is not compatible?
Thank you so much for the help! 😊
The text was updated successfully, but these errors were encountered: