com.google.cloud:google-cloud-speech:4.56.0 conflicts with com.unity3d.ads:unity-ads:4.16.5

4 hours ago 1
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.AbstractMessageLite

Fix (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.

Harsh Solanki's user avatar

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.

Read Entire Article