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 2.0.0 alphas causes havoc with KAPT / Room

See original GitHub issue

Describe the bug This library forces us to add -Xjvm-default=all to the compiler properties, which causes issues with Kapt.

To Reproduce

  1. Enable Coil and Room in the same project
  2. Implement a coil interface that uses @JvmDefault underneath (for example coil.transform.Transformation) - this forces us to add -Xjvm-default=all to the compiler properties,
  3. Room build will fail with some cryptic errors, like error: not an enclosing class: MyDao

Version Coil 2.0.0 alpha-06, room 2.4.1, kotlin 1.6.10

This has happened before with 1.x (#507), so it is a returning regression.

I don’t think a library should force developers to add any compiler flags, especially when those flags break things.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
matejdrocommented, Jan 26, 2022

Issue seems to be @Transaction methods.

Google is supposed to have fixed that in November, but it is still happening: https://issuetracker.google.com/issues/199546642. I have attached repro zip as a comment to that ticket.

Thanks for the detailed explanation, I see now that it is generally a good idea to enable this and it is the Room that is the problem here, not Coil.

0reactions
matejdrocommented, Mar 3, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

-Xjvm-default=all requirement for 1.0.0 causes havoc with ...
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 ...
Read more >
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 >

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