Open arpank10 opened 1 year ago
I am facing a similar problem, ksp saying all the time the error "Prefix property cannot be empty". I set the prefix and checked everything hundred of times and nothing
Needed some time to reach what was happening but I found the reason of my problem. Seems that android BuildConfig variables are not supported in the DeepLink annotations because of a KSP limitation. I was using them as the root domain and then the processor was ignoring them like i wasn't set a value.
prefix = [ "https://" + BuildConfig.API_URL ] -> Doesn't work (handles it as empty string) prefix = [ "https://example.com" ] -> Works
I worked on a workaround until google fixes ksp. Hope it helps if someone has the same problem. You need to put it in gradle.build, inside android section.
androidComponents {
onVariants(selector().all(), { variant ->
afterEvaluate {
def variantName = variant.name.capitalize()
def kspKotlinTaskName = "ksp${variantName}Kotlin"
project.tasks.named(kspKotlinTaskName) { kspKotlinTask ->
def genBuildConfigTaskName = "generate${variantName}BuildConfig"
def genBuildConfigTask = project.tasks.named(genBuildConfigTaskName).get()
kspKotlinTask.setSource(
genBuildConfigTask.sourceOutputDir
)
}
}
})
}
Updated Version : v6.1.0 Previous Version: v5.4.3
Annotation processor used: kapt
We have custom annotations to register deep links, they are defined like this:
The functions are defined as follows:
The custom annotations were working fine with version 5.4.3, but they are not generated in the Registry with the new version.
Note: We have tried adding Retention(AnnotationRuntime.RUNTIME) to our custom annotation The custom annotations are also added to our build.gradle and incremental processing is enabled.