android / codelab-android-datastore

Apache License 2.0
228 stars 105 forks source link

protoc 21.7 not found #63

Open qpl23 opened 1 year ago

qpl23 commented 1 year ago

I originally thought this was a typo, but it seems protoc 21.7 does exist. So, edit:

The build.gradle snippet in the web tutorial specifies:

  protoc {
        artifact = "com.google.protobuf:protoc:21.7"
    }

But Android Studio can't find protoc 21.7 with the provided repository setting:

    repositories {
        google()
        mavenCentral()
    }

giving the error:

> Could not resolve all files for configuration ':app:protobufToolsLocator_protoc'.
   > Could not find com.google.protobuf:protoc:21.7.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/google/protobuf/protoc/21.7/protoc-21.7.pom
       - https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/21.7/protoc-21.7.pom
     Required by:
         project :app

Changing the protoc stanza to read artifact = "com.google.protobuf:protoc:3.21.7" (i.e. changing the version from 21.7 to 3.21.7) makes this problem go away.

coalacorey commented 1 year ago

I concur. This little maneuver just cost me 51 years.

alexs60 commented 1 year ago

the version is 3.21.7. is missing a 3

diegum commented 1 year ago

Weird that this lab got updated less than a week ago, but this issue wasn't fixed.

I have some feeling that googlers may omit the 3. without worrying about it, and some project building framework completes it on their behalf. Otherwise, they merge things without testing them.

klemensz commented 11 months ago

It's strange that this issue doesn't show up in Google when searching for the error message "Could not find com.google.protobuf:protoc:21.7." 🤔 That would probably save people that run into the same problem some time.

qwertystar commented 10 months ago

Actually in source code of codelabs,it is artifact = "com.google.protobuf:protoc:3.19.4" that means there was a mistake here.

rickyManalo commented 6 months ago

Still not fixed