philipplackner / Room-CMP

19 stars 1 forks source link

KSP #1

Open negarin99 opened 3 months ago

negarin99 commented 3 months ago

hi . this is issue on windows 11 when create database class and make project :

Task :composeApp:kspDebugKotlinAndroid FAILED

exception: info: [ksp] loaded provider(s): [androidx.room.RoomKspProcessor$Provider] exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:37:69: error: expecting an expression exception: val _openDelegate: RoomOpenDelegate = object : RoomOpenDelegate(?, exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:37:69: error: expecting ')' exception: val _openDelegate: RoomOpenDelegate = object : RoomOpenDelegate(?, exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:38:9: error: type expected exception: "8841107b83bd7858c513c0db42576cba", "03efd2570bb11b60501b041ff606118e") { exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:38:10: error: expecting a class body exception: "8841107b83bd7858c513c0db42576cba", "03efd2570bb11b60501b041ff606118e") { exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:38:10: error: unexpected tokens (use ';' to separate expressions on the same line) exception: "8841107b83bd7858c513c0db42576cba", "03efd2570bb11b60501b041ff606118e") { exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:66:75: error: expecting an expression exception: _columnsPerson.put("name", TableInfo.Column("name", "TEXT", true, ?, null, exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:66:75: error: expecting ')' exception: _columnsPerson.put("name", TableInfo.Column("name", "TEXT", true, ?, null, exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:67:43: error: unexpected tokens (use ';' to separate expressions on the same line) exception: TableInfo.CREATED_FROM_ENTITY)) exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:68:74: error: expecting an expression exception: _columnsPerson.put("id", TableInfo.Column("id", "INTEGER", true, ?, null, exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:68:74: error: expecting ')' exception: _columnsPerson.put("id", TableInfo.Column("id", "INTEGER", true, ?, null, exception: ^ exception: composeApp\build\generated\ksp\android\androidDebug\kotlin\database\PeopleDatabase_Impl.kt:69:43: error: unexpected tokens (use ';' to separate expressions on the same line) exception: TableInfo.CREATED_FROM_ENTITY)) exception: ^

Nirav186 commented 1 month ago
kotlin = "2.0.20-RC"
room = "2.7.0-alpha01"
ksp = "2.0.20-RC-1.0.24"

and add ksp.useKSP2=true to your gradle.properties (if you are using kotlin 2.x.x) this will fix your problem and if you still getting the same error then try to remove @TypeConverters(<converter class name>::class)