Skip to main content
The 2024 Developer Survey results are live! See the results

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
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, ...
Mostafa Shafayi's user avatar
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 ...
Opicak's user avatar
  • 21
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....
spikanor's user avatar
  • 115
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 ...
Muhammad Ahmed AbuTalib's user avatar
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 ...
Nikolay Ch's user avatar
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:- @...
Hector's user avatar
  • 4,874
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&...
Hector's user avatar
  • 4,874
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 ...
rafaelasguerra's user avatar
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....
Vikram Baliga's user avatar
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&...
user22758998's user avatar
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 ...
Gelson Schikorski's user avatar
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-...
kasimaru13's user avatar
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 ...
GuilhE's user avatar
  • 11.8k
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 ...
Michael Appiah-kubi's user avatar
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] [...
Gregorian's user avatar

15 30 50 per page