Skip to content

Could not get unknown property 'source' for generate-proto-generateDebugProto of type #81

@TinaT2

Description

@TinaT2

These are 2 errors that I've faced on Working with Proto DataStore:
Could not get unknown property 'source' for generate-proto-generateDebugProto of type
and
error: Unresolved reference: protoc

On gradle-8.11.1 and kotlin-gradle.

Here is the resolve:

In build.gradle instead of previous protobuf version:

protobuf {
     protoc {
     //the version here should be the same as what you have in your app build.gradle
        artifact = "com.google.protobuf:protoc:3.18.0"
    }

    generateProtoTasks {
        all().configureEach {
            builtins {
                create("java") {
                    option("lite")
                }
            }
        }
    }
}
java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}

And in build.gradle project level:

plugins {
//...
    id("com.google.protobuf") version "0.9.5" apply false 
}

The rest remains the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions