https://kotlinlang.org logo
#k2-early-adopters
Title
# k2-early-adopters
j

jschneider

11/18/2023, 9:07 AM
I have another strange exception This is related to this line:
@file:UseSerializers(UuidSerializer::class)
As you can see, again the banasher44 UUID library is again somewhere in the vicinity. I tried to play around with the order of the dependencies in the build.gradle.kts. But could not solve this issue. I suspect that somehow the dependency resolution might have some bugs which (also) lead to this exception. (The code compiles fine with 1.9.20)
Copy code
org.jetbrains.kotlin.fir.pipeline.FirUtilsKt.resolveAndCheckFir(firUtils.kt:72)
        at org.jetbrains.kotlin.cli.metadata.FirMetadataSerializer.analyze(FirMetadataSerializer.kt:109)
        at org.jetbrains.kotlin.cli.metadata.FirMetadataSerializer.analyze(FirMetadataSerializer.kt:49)
        at org.jetbrains.kotlin.cli.metadata.AbstractMetadataSerializer.analyzeAndSerialize(AbstractMetadataSerializer.kt:34)
        at org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler.doExecute(K2MetadataCompiler.kt:134)
[...]
        at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.AssertionError: Argument for kotlinx.serialization.UseSerializers does not implement KSerializer or does not provide serializer for concrete type
        at org.jetbrains.kotlinx.serialization.compiler.fir.services.ContextualSerializersProvider$special$$inlined$createCache$2.invoke(FirCachesFactory.kt:82)
        at org.jetbrains.kotlinx.serialization.compiler.fir.services.ContextualSerializersProvider$special$$inlined$createCache$2.invoke(FirCachesFactory.kt:69)
        at org.jetbrains.kotlin.fir.caches.FirThreadUnsafeCache.getValue(FirThreadUnsafeCachesFactory.kt:40)
        at org.jetbrains.kotlinx.serialization.compiler.fir.services.ContextualSerializersProvider.getAdditionalSerializersInScopeForFile(ContextualSerializersProvider.kt:170)
[...]
I suspect that these problems might arise, because I have two different dependencies with the same artifact ID ("uuid"). Could this explain the problems? Maybe somewhere only the artifact id is used as key?
i

Ivan Kubyshkin [JetBrains]

11/20/2023, 9:47 AM
Please file an issue and attach a sample project.
j

jschneider

11/20/2023, 10:09 AM
t

tapchicoma

11/20/2023, 2:17 PM
@jschneider hi, could you tell us what exact libraries with the same module name are you using?
j

jschneider

11/21/2023, 12:09 PM
https://github.com/jschneider/KT-63573 I am not sure why you can't reproduce this problem. It seems to be very straightforward for me...
t

tapchicoma

11/21/2023, 1:03 PM
to reproduce we need a repro project 🙂 Thank you - we will take a look into it
j

jschneider

11/21/2023, 5:28 PM
Yeah, but to be honest it is a major bug in your software. And while I am very willing to help and find bugs, I hoped you would also try to reproduce the issue. I think it is kind of harsh to not only expect bug reports but also require reproducible projects (at least for such important bugs). 😉