Open kanetik opened 1 year ago
I am also experiencing the same issue where I am unable to update to 1.9.20
I have the same issue I don't know what I can do.
Snippet from my build.gradle.kts
that works for my project:
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.0"
generateProtoTasks {
all().forEach { task ->
task.builtins {
create("java") {
option("lite")
}
}
}
}
}
}
androidComponents {
onVariants(selector().all()) { variant ->
afterEvaluate {
val protoTask =
project.tasks.getByName("generate" + variant.name.replaceFirstChar { it.uppercaseChar() } + "Proto") as GenerateProtoTask
project.tasks.getByName("ksp" + variant.name.replaceFirstChar { it.uppercaseChar() } + "Kotlin") {
dependsOn(protoTask)
(this as org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool<*>).setSource(
protoTask.outputBaseDir
)
}
}
}
}
Whose responsibility is it to resolve the issue?
Here is the snippet for my workaround, based on the above and the one for SQLDelight I found here.
androidComponents {
onVariants(selector().all()) { variant ->
afterEvaluate {
val capName = variant.name.capitalized()
tasks.getByName<KotlinCompile>("ksp${capName}Kotlin") {
setSource(tasks.getByName("generate${capName}Proto").outputs)
}
}
}
}
Just have this above workaround as legacy Groovy for someone might need it
androidComponents {
onVariants(selector().all(), { variant ->
afterEvaluate {
def capName = variant.name.capitalize()
tasks.getByName("ksp${capName}Kotlin") {
setSource(tasks.getByName("generate${capName}Proto").outputs)
}
}
})
}
I am experiencing this as well. The workaround that @felixzheng posted above fixes it.
same here
Same here.
same here!!!!
I have set up Proto Datastore in my app, and it was all working perfectly until I upgraded the KSP plugin from version 1.9.10-1.0.13 to 1.9.20-1.0.14 tonight. After some experimenting, I can say that it does work up to 1.9.20-RC-1.0.13 and does not work from 1.9.20-RC2-1.0.13 through 1.9.20-1.0.14, so it appears that one of the changes introduced in the RC2 release broke something w/ that processing.
I have my proto file in the standard location (src\main\proto) and my configuration in build.gradle.kts (the module one) is
The error I get when the build fails is: