https://kotlinlang.org logo
Title
b

bj0

05/15/2023, 11:18 PM
I've never used arrow before so i tried to add it to an existing project and created a function with typed errors based on the documentation, but I'm getting the following compile error:
> Task :cfe:kaptDebugKotlin FAILED
/mnt/data/code/android/app/app/build/tmp/kapt3/stubs/debug/.../app/MessageServiceKt.java:13: error: cannot access Raise
    arrow.core.raise.Raise<? super CommandError> $this$parseMessage, @org.jetbrains.annotations.Nullable
                    ^
  bad class file: /home/user/.gradle/caches/transforms-3/3dfc757af27868464b7f0dfba03b664d/transformed/jetified-arrow-core-jvm-1.2.0-RC.jar(/arrow/core/raise/Raise.class)
    undeclared type variable: T
    Please remove or make sure it appears in the correct subdirectory of the classpath.
I tried searching but Google only has 2 hits, one is an unanswered github issue on the dagger project and the other is a log of this chat from 3 weeks ago that said "maybe it will be fixed in 1.8.21" (it isn't). Anyone know the cause or a workaround to this issue?
s

simon.vergauwen

05/16/2023, 5:09 AM
Hey @bj0, This is really confusing to me since
Raise
is just an
interface
. Is
Raise
and any kapt related code in the same file? Someone reported to me that moving it to a separate file fixed the problem for them
b

bj0

05/16/2023, 3:55 PM
The only thing I can think that would be kapt related would be one
data class
which is
@Serializable
i moved it out of the file and i get the same error
the generated code looks normal, why would it be saying
bad class file
to the downloaded
arrow-core-jvm
file?
s

simon.vergauwen

05/16/2023, 4:48 PM
@Serializable
from KotlinX is not kapt but a compiler plugin
Hmm, that’s really weird 😕
b

bj0

05/16/2023, 5:32 PM
I upgraded to AGP 8 which requires JDK 17, could it be related to the JDK version? (seems like kapt ignores
jvmTarget
https://youtrack.jetbrains.com/issue/KT-55947)
the only thing i'm using kapt for, then, is dagger, but there is no dagger code in the file with
Raise