google / google/ksp

[KSP2] Room PROCESSING_ERROR

Open
#2,169 3 comments 7 reactions 0 assignees View on GitHub
XProcessing
Dominant language
Kotlin
Stars
3.5k
Forks
415
Avg merge
1d 2h
Merged PRs (30d)
53

Description

Hi, I am using the following libraries
```
kotlin = "2.0.21"
kotlinKsp = "2.0.21-1.0.26"
room = "2.6.1"
```
and have KSP2 turned on
`ksp.useKSP2=true`

I am getting this PROCESSING_ERROR error:
```
e: [ksp] Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).
Tried the following constructors but they failed to match:
-> [param:fileType -> matched field:unmatched, param:fileName -> matched field:unmatched] -
e: [ksp] Not sure how to convert a Cursor to this method's return type.
```
I have this simple query:
```
@Query("SELECT file_name AS fileName, file_type AS fileType FROM file")
fun getFiles(): Single>
```
and this sealed class (FileType is enum):
```
sealed class File{
data class FileTypeAbcd(
val fileType: FileType,
val fileName: String
) : File()
.
.
.
}
```

This worked fine with KSP1. It seems there is some problem with returning type being child of sealed class?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.