question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

-Xjvm-default=all requirement for 1.0.0 causes havoc with KAPT / Room

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
matejdrocommented, Jan 21, 2022

Why was this added again in 2.0.0-alpha01?

@colinrtwhite I think this issue might need reopening.

2reactions
Koitharucommented, Aug 26, 2020

Just replace interface with an abstract class source

Read more comments on GitHub >

github_iconTop Results From Across the Web

Room kapt error when upgrading kotlin or gradle
In my case, I have faced the same issue while I have upgraded "kotlin-gradle-plugin: from 1.5.31 to 1.6.10".
Read more >
Generate default methods for implementations in interfaces
-Xjvm-default=all generates JVM default methods only, and thus is binary ... This issue causes weird errors with Spring Data repository interfaces.
Read more >
What's new in Kotlin 1.6.20
Kotlin 1.6.20 introduces the new annotation @JvmDefaultWithCompatibility : use it along with the -Xjvm-default=all compiler option to create ...
Read more >
Support compatibility mode for JVM default in Kotlin for ...
There is simple reproduction scenario with enabled compatibility mode in gradle ``` android { defaultConfig { minSdkVersion 16 //starts work with 21 }...
Read more >
-Xjvm-default=all requirement for 2.0.0 alphas causes havoc ...
Describe the bug This library forces us to add -Xjvm-default=all to the compiler properties, which causes issues with Kapt.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found