-
Notifications
You must be signed in to change notification settings - Fork 354
Description
Updating KSP from 2.2.20-2.0.2 to 2.2.20-2.0.3 causes conflicts and build errors when using protobuf.
2.2.20-2.0.2 version (and previous) work absolutely fine
- Exception is:
org.gradle.internal.execution.WorkValidationException: Some problems were found with the configuration of task '::generateDebugProto' (type 'GenerateProtoTask').-
Gradle detected a problem with the following location: '<project_path><module>\build\generated\sources\proto\debug\java'.
Reason: Task '::kspDebugKotlin' uses this output of task '::generateDebugProto' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
- Declare task '::generateDebugProto' as an input of '::kspDebugKotlin'.
- Declare an explicit dependency on '::generateDebugProto' from '::kspDebugKotlin' using Task#dependsOn.
- Declare an explicit dependency on '::generateDebugProto' from '::kspDebugKotlin' using Task#mustRunAfter.
-
Setup:
// toml
ksp = "2.2.20-2.0.3"
protobufJavalite = "4.32.1"
protobuf-javalite = { module = "com.google.protobuf:protobuf-javalite", version.ref = "protobufJavalite" }
// build.gradle
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${libs.versions.protobufJavalite.get()}"
}
generateProtoTasks {
all().configureEach {
plugins {
create("java") {
option("lite")
}
}
}
}
}