KSP with Version Catalog

769 views Asked by At

i want to migrate from kapt to ksp and all is done. but if i combine version catalog with ksp, error is show.

this is my code on gradle previously and all is done. ksp "androidx.room:room-compiler:$version"

BUT if i combine with version catalog, the error is show,

gradle: kasp(libs.room.compiler)

error:

Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method kasp() for arguments [map(valueof(DependencyValueSource))] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

actually, i can make the code as this, but i don't want to use it ksp "androidx.room:room-compiler:${libs.versions.room.get()}"

i just want to keep like this kasp(libs.room.compiler)

sorry if my explanation is wrong and ambigous

expect: kasp(libs.room.compiler) with no error

reality:

Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method kasp() for arguments [map(valueof(DependencyValueSource))] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

try: ksp "androidx.room:room-compiler:${libs.versions.room.get()}"

1

There are 1 answers

0
Barry Irvine On

You've said kasp but it looks like a typo.

ksp(libs.room.compiler)

Works for me