I am trying to use protobuf datastore on Android but I am facing a build issue. below is the errors:
Duplicate class com.google.protobuf.Field$Kind$KindVerifier found in modules jetified-protobuf-javalite-3.21.11 (com.google.protobuf:protobuf-javalite:3.21.11) and jetified-protobuf-kotlin-4.26.0 (com.google.protobuf:protobuf-kotlin:4.26.0)
Duplicate class com.google.protobuf.FieldKt found in modules jetified-protobuf-kotlin-4.26.0 (com.google.protobuf:protobuf-kotlin:4.26.0) and jetified-protobuf-kotlin-lite-3.21.11 (com.google.protobuf:protobuf-kotlin-lite:3.21.11)
This only a part of the logs, but there is a ton of lines repeating the Duplicate class
below is my gradle:
plugins {
id 'kotlinx-serialization'
id "com.google.protobuf" version "0.8.17"
}
dependencies {
implementation "androidx.datastore:datastore:1.1.0"
implementation "com.google.protobuf:protobuf-javalite:3.19.4"
implementation "com.google.protobuf:protobuf-kotlin-lite:3.21.11"
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.19.4"
}
// Generates the java Protobuf-lite code for the Protobufs in this project. See
// https://github.com/google/protobuf-gradle-plugin#customizing-protobuf-compilation
// for more information.
generateProtoTasks {
all().each { task ->
task.builtins {
java {
option 'lite'
}
kotlin {
option 'lite'
}
}
}
}
}
Any idea?
I tried multiple change in version but nothing changed