-Xjvm-default=all requirement for 2.0.0 alphas causes havoc with KAPT / Room
See original GitHub issueDescribe the bug
This library forces us to add -Xjvm-default=all
to the compiler properties, which causes issues with Kapt.
To Reproduce
- Enable Coil and Room in the same project
- Implement a coil interface that uses
@JvmDefault
underneath (for examplecoil.transform.Transformation
) - this forces us to add-Xjvm-default=all
to the compiler properties, - 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:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
Heads up: Room has released a fix https://developer.android.com/jetpack/androidx/releases/room#2.4.2