Skip to content

2.2.20-2.0.3 + protobufJavalite build errors #2596

@alexmirash

Description

@alexmirash

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:

      1. Declare task '::generateDebugProto' as an input of '::kspDebugKotlin'.
      2. Declare an explicit dependency on '::generateDebugProto' from '::kspDebugKotlin' using Task#dependsOn.
      3. 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")
}
}
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions