Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

protobuf build failures #130

Open
KevinQuinnMT opened this issue Sep 2, 2021 · 1 comment
Open

protobuf build failures #130

KevinQuinnMT opened this issue Sep 2, 2021 · 1 comment

Comments

@KevinQuinnMT
Copy link

Hello,

The short version is, would it be possible to rebuild the speech, and specifically streaming speech projects so they do not currently fail. Currently these samples are non functional because of changes to the android ecosystem.

The longer version is:

I have created a voice solution heavily based on the speech to text examples found in this repository. It has been working in a production environment for a while, but recently it has encountered crashing in newer android devices. The crashing seems to be related to

grpc/grpc-java@5803dfd

however attempting to rebuild protobuf results in this error

  • an enum switch case label must be the unqualified name of an enumeration constant can be found in many of the proto generated files

  • cannot find symbol class Visitor

  • cannot find symbol variable MergeFromVisitor

build/generated/source/proto/debug/javalite/com/google/cloud/speech/v1/StreamingRecognizeResponse.java
........

This seems to be related to
https://stackoverflow.com/questions/59606918/cloud-speech-v1-streamingrecognizeresponse-error-an-enum-switch-case-label-mu

Which is referencing this ( https://github.com/GoogleCloudPlatform/android-docs-samples ) repository.

i was able to get the above error to resolve by making the following changes:

buildscript {

...

dependencies {

    classpath 'com.android.tools.build:gradle:3.5.3'

    classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.8' <-- TO --> classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.17'

}

}

ext {

grpcVersion = '1.4.0' <-- TO --> grpcVersion = '1.39.0'

}

android {

compileSdkVersion 28 <-- TO --> 30

buildToolsVersion '28.0.0' <-- TO --> '29.0.3'



defaultConfig {

    minSdkVersion 16 <-- TO --> 23

    targetSdkVersion 28 <-- TO --> 30

    <-- ADD -- > compileSdkVersion 30

    ...

}

}

dependencies {

implementation "io.grpc:grpc-okhttp:$grpcVersion"

implementation "io.grpc:grpc-protobuf-lite:$grpcVersion"

implementation "io.grpc:grpc-stub:$grpcVersion"

implementation 'javax.annotation:javax.annotation-api:1.2'  <-- TO -->  implementation 'javax.annotation:javax.annotation-api:1.3.2'

protobuf 'com.google.protobuf:protobuf-java:3.3.1' <-- TO --> protobuf 'com.google.protobuf:protobuf-java:3.17.3'

...

}

protobuf {

protoc {

    artifact = 'com.google.protobuf:protoc:3.3.0' <-- TO --> artifact = 'com.google.protobuf:protoc:3.17.3'

}

however these new versions have their own problems -

new Error after updating a number of various build.gradle plugins and repository versions

Execution failed for task ':generateDebugProto'.

protoc: stdout: . stderr: C:\Users\KQUINN\Programming\Node.js\React-Native\Meditech\mob_library_react_native_voice\src\android\build\extracted-protos\main\google\protobuf\any.proto: Input is shadowed in the --proto_path by "C:/Users/KQUINN/Programming/Node.js/React-Native/Meditech/mob_library_react_native_voice/src/android/build/extracted-include-protos/debug/google/protobuf/any.proto". Either use the latter file as your input or reorder the --proto_path so that the former file's location comes first.

This last problem seems to be what is exactly described in
grpc-ecosystem/polyglot#110

If it is possible to update the samples that would be very helpful, as it could be used as a basis to update my own project. As it stands I only have a cursory understanding of protobuf files and the protobuf compilation process, so any assistance towards resolving protobuf compilation errors would be appreciated!

Thank You,
Kevin

@HQTracy
Copy link

HQTracy commented Jun 17, 2022

I also encountered the same problem, did you solve it, thank you very much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants