-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[KSP2] Errors with Room annotations with KSP2 #1896
Comments
can you please also file an issue to Room for this? They should have better knowledge on the matter. |
@neetopia it builds with that scenario after updating KSP to 2.0.0-1.0.21. However, there is a very similar error when having the
I'll update the Room issue as well, but it sounds like a KSP issue? @Database(entities = [Item::class], version = 1, exportSchema = false)
@TypeConverters(
ItemConverters::class
)
abstract class MyDatabase : RoomDatabase() {
} |
Thanks for the update. Updating in the room issue would certainly help with our investigation. |
Would be useful it said WHICH type that it is referencing that is not present.
Hitting this with KSP2 and room as well. Here is the full stack trace:
|
@stevenzeck Try this to see if it works around the issue: @TypeConverters(
ItemConverters::class,
builtInTypeConverters = BuiltInTypeConverters()
) |
Sort of guessing here, but room has this
KSP2 seems to have an issue resolving Which seems to indicate a KSP2 issue or Kotlin Analysis API issue, and not a Room issue? |
@yogurtearl yep that resolves that specific issue. |
I think this is the same issue as #1833 , which after investigation we found it is a bug in analysis API, a fix in upstream is likely needed. |
@neetopia yeah, the original issue with If the issue with TypeConverters is an upstream issue, can probably close this and use 1833. |
other alternative way to solve this? |
I have the same problem in Fedora android/nowinandroid#1521 |
I found a solution for that same problem in Fedora android/nowinandroid#1521 |
We're getting the following stack trace error:
Versions: the type converter comes from an external library, lint is able to locate the type converter without any problems. |
Have the same problem KSP - 2.0.0-1.0.24 |
Have the same problem, but in my case besides TypeConverters, annotation Embeded and Relation will also cause the error, which I have not yet found any workaround. |
Updating KSP version in the test case by OP to 2.0.20-1.0.24 makes the build pass. Please share test cases / logs / anything if you're still seeing the issue. |
The original issue with Error with
|
@stevenzeck Having the same issue when using the |
Thank you !!! @nabeelahamedk. You has save my life |
Updating from
Still getting:
Unfortunatly this project is not open source, cannot share a MRE. |
For the TypeConverters #2077 should be the cause. |
using
|
May I know the version of Room you're using? Could you try to update it to the latest? There was a known issue in Room where some objects are held across rounds and caused |
Using |
have you added
|
This problem only happens with |
@GuilhE I solved this issue by 8 long hours and the thing is that I removed Is there any workaround that you will manage to remove the type converter? |
I tried the nightly build, and TypeConverters are fixed there. |
Could you please tell us what Kotlin, KSP and Room versions you use? Because I am using the latest nightly for Room and ksp, and I still encouter the
|
Sorry for the late reply. I'm using the same KSP and Kotlin versions, with Room still on 2.6.1. Edit: I'm actually getting a different error this morning, not related to TypeConverters: |
@ting-yuan I'm having this issue with
|
When I enable KSP2 through gradle.properties (
ksp.useKSP2=true
), I get errors when compiling a Room database that uses a serialized entity.It's as simple as having this entity:
And this database:
Minimal reproducible repository: https://github.com/stevenzeck/KspIssueRepo. If you remove
ksp.useKSP2
, it works fine. If you remove@Serializable
in the entity, it works fine. If you keep@Serializable
and remove the Room annotations, it works fine.The text was updated successfully, but these errors were encountered: