Questions tagged [kotlin-symbol-processing]
The Kotlin Symbol Processing API (KSP) allows to write code that is executed when compiling a Kotlin application. Use this tag in questions about the Kotlin Symbol Processing API and writing symbol processors.
kotlin-symbol-processing
41
questions
0
votes
1
answer
56
views
KSP library for room
I want to use the room library for database, when I add the room library to my project, I can easily use it and I have no problem, but in order to be able to use room properly, I must I use ksp, well, ...
2
votes
0
answers
74
views
Kotlin Multiplatform and Room: Cannot find implementation for model.database.AppDatabase
I'm making an app with Kotlin Multiplatform. I encountered an error when implementing the Room database, using this tutorial.
The error goes like this (Note that this error appears while debugging on ...
2
votes
0
answers
34
views
KSP2 throwing NPE during build
I am using Room with KSP, which is giving this error during Gradle build:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':shared:kspCommonMainKotlinMetadata'.
at org....
2
votes
1
answer
123
views
Is Room KMP support available for a project with no shared UI?
I have suspicion that the shared.build.kts of a KMP project with native UIs , has an issue with the ksp block in ios code .
I do not understand KSP accurately but from my initial investigation it does ...
1
vote
1
answer
815
views
Migrating to Kotlin 2.0 causes error with KSP
After migrating to Kotlin 2.0, when I sync the project with the gradle files no issues arise. However, when I try to deploy to the device, I get the following error:
> Task :app:kspDebugKotlin ...
0
votes
0
answers
50
views
Android Room ksp processing does not cope with nullability correctly
My android application has the following room dao function
@RawQuery
@Transaction
abstract suspend fun queryOneOrNone(query: SupportSQLiteQuery): TEntity?
kapt generates the following java code:-
@...
0
votes
0
answers
66
views
Android room dao generation fails afrer Migrating to ksp from kapt due to TypeAlias
I have migrated from kapt to ksp for my current android project.
All my dao(s) extend a base dao that is defined as a kotlin typealias as follows:-
typealias BaseDao<T> = AbstractDao<T, Long&...
1
vote
1
answer
181
views
KSP - How to consolidate module results into a file
I am looking to utilize KSP to generate a comprehensive list of feature flags across various modules in my project, including the 'app', 'module1', 'module2', up to 'moduleN'.
Currently, I have a code ...
0
votes
4
answers
3k
views
Unable to enable ksp for room database when using kotlin DSL build script
Problem: I want to use ksp with room. On adding ksp(libs.androidx.room.compiler) in the module level build.gradle.kts file, I get the following error:
Unable to load class 'org.jetbrains.kotlin....
1
vote
1
answer
165
views
Can we read value of a variable in a class using KSP?
I have a class which has some variables, can we use kotlin symbol processing api to somehow read the value of the variable declared in the class?
resolver.getDeclarationsFromPackage("com.example&...
2
votes
1
answer
2k
views
Migrating Room from KAPT to KSP leads to RuntimeException
My DB was all right before it, I migrated from KAPT to KSP as follows documentation (https://developer.android.com/build/migrate-to-ksp), it worked fine for Hilt library, but when I change Room ...
0
votes
1
answer
415
views
Jetpack Compose: Impossible to use Room (dependencies problem)
I've tried to use room but I can't even add its dependency to my project. When I add these lines (which are on the official tutorial: https://developer.android.com/codelabs/basic-android-kotlin-...
2
votes
1
answer
374
views
Kotlin Multiplatform generated code is not aware of target's code
I've a KMP shared module that imports a KSP library to generate code for iOS targets, and it works as expected:
However, I’m facing a strange behavior; my generated code cannot see/access what’s in ...
3
votes
4
answers
2k
views
How to correctly add Room Persistence dependencies to my Jetack Compose Android app
I have been struggling to add Room dependencies for a couple of days now(not proud). There is always an error no matter what i try. I am not the most experienced though.
I added the below from the ...
0
votes
1
answer
621
views
Android Compose doesn't work with KSP, ROOM for multi-module projects
I noticed after enabling Android Compose for the project:
buildFeatures {
compose true
}
KSP with ROOM doesn't work properly finishing with exceptions like this during bulding project:
[ksp] [...