Describe the bug
I've tried to add freeCompilerArgs = listOf("-Xjvm-default=all") to my kotlinOptions block, but the code for my Jetpack Room DAO's do not compile correctly anymore, giving errors about annotations which apparently were dropped. Maybe this is more of a kapt bug, but makes it impossible to use the latest version of Coil.
Expected behavior
My project still compiles.
To Reproduce
Use a Room DAO with coil 1.0.0 and kapt.
Logs/Screenshots
../build/tmp/kapt3/stubs/appDebug/com/foo/bar/localdb/MyDetailsDao.java:27: error:
An abstract DAO method must be annotated with one and only one of the following annotations: Insert,Delete,Query,Update,RawQuery
public com.foo.bar.MyDetails insertOrUpdate(@org.jetbrains.annotations.NotNull()
^../build/tmp/kapt3/stubs/appDebug/com/foo/bar/localdb/MyDetailsDao.java:15: error:
Abstract method in DAO must be annotated with interface androidx.room.Query AND interface androidx.room.Insert
public abstract interface AugmentedSkuDetailsDao {
Version
1.0.0-rc1
Just replace interface with an abstract class
source
Yep, it seems like the jvm-default flag is slightly buggy in Kotlin 1.4.0 (the compiler also fails to compile the library with jvm-default=all-compatibility). I'd like to introduce this change as part of the 1.0.0 release as it's a binary incompatible change, however if the flag is unstable, I'll revert the change. In the meantime I'd recommend using Coil 0.12.0 - it's the same release, however compiled with 1.3.72.
Just replace
interfacewith anabstract class
source
This solution works for me
1.0.0-rc3 removes the -Xjvm-default=all requirement due to instability.
Most helpful comment
Just replace
interfacewith anabstract classsource