ARTICLE AD BOX
You cannot use protobuf-java and protobuf-javalite together because both include the same core classes, which causes duplicate class errors. Only one version should be used in your project.
protobuf-java is the full version of Protobuf, mainly used in server or desktop environments.
protobuf-javalite is a lightweight version designed for Android.
When both are included, Gradle throws errors like:
Duplicate class com.google.protobuf.AbstractMessageLiteFix (quick solution)
Exclude the full Protobuf dependency from google-cloud-speech:
implementation("com.google.cloud:google-cloud-speech:4.56.0") { exclude group: "com.google.protobuf", module: "protobuf-java" }This ensures only the lite version is used and resolves the conflict.
Explore related questions
See similar questions with these tags.
