You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a SDK which uses protobuf java. Since the firebase uses protobuf java lite. It results in duplicate class exception.
I cannot exclude protobuf from my SDK dependency because that would cause a java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/protobuf/GeneratedMessageV3; exception.
If I exclude protobuf from firebase. It still shows duplicate class exception because it has a nested dependency. com.google.firebase:protolite-well-known-types:18.0.0@aar
They have created a package with com.google.protobuf inside this module.
I cannot exclude this dependency, because it would result in same NoClassDefFoundError.
Hi @V-Abhilash-1999, thanks for reaching out to us. I noticed that you're using an older version of the SDK. I don't think this would make any difference but could you try updating to the latest version of Firestore version 24.5.0 (BoM: 31.5.0) and see if this resolves the issue? We usually advise this to avoid issues or fixes that have been made in the most recent versions.
May I know which specific library of protobuf java and version are you using? Also any chance you could share with us a minimal reproducible example of your issue? It'll help us a lot. Thanks!
I am sorry. I was a bit busy.
I could depend on protobuf-javalite, but that would remove JSON support (JSON to proto conversion).
So I was looking for a way to keep using protobuf-java.
Also on an unrelated note,
I tried to convert my library to protobuf-javalite, while testing I came across a issue, where my library uses protobuf-javalite and Application uses protobuf-java. In this case, If I were to exclude protobuf-javalite, it results in java.lang.VerifyError: Verifier rejected class on google.protobuf.FloatValue.
Upon further investigating, i came across this issue #2165
Is migrating to protobuf-javalite the only solution for this?
It seems like you are depending on protobuf-java directly. In this case, what you could do is to pulling protobuf-java and rename its package. Not ideal, but if you really want to keep the protobuf to json feature, this is the only way I am aware of.
Why is there a verify error when excluding protobuf-javalite in firebase? I am also facing a similar issue (if I am using FloatValue in my proto). How to avoid it?
Update: Firebase Android BoM version 35.0.0 (released October 07, 2026) includes #8580 which upgrades the gRPC and protobuf dependencies to their latest versions. This may fix the problems reported in this issue. Please try upgrading and report your findings.
Activity
google-oss-bot commentedon Apr 24, 2023
I found a few problems with this issue:
argzdev commentedon Apr 25, 2023
Hi @V-Abhilash-1999, thanks for reaching out to us. I noticed that you're using an older version of the SDK. I don't think this would make any difference but could you try updating to the latest version of Firestore version
24.5.0(BoM:31.5.0) and see if this resolves the issue? We usually advise this to avoid issues or fixes that have been made in the most recent versions.May I know which specific library of protobuf java and version are you using? Also any chance you could share with us a minimal reproducible example of your issue? It'll help us a lot. Thanks!
wu-hui commentedon Apr 26, 2023
Is it at all possible for you to depend on protobuf-lite?
V-Abhilash-1999 commentedon Apr 26, 2023
I am sorry. I was a bit busy.
I could depend on protobuf-javalite, but that would remove JSON support (JSON to proto conversion).
So I was looking for a way to keep using protobuf-java.
Also on an unrelated note,
I tried to convert my library to protobuf-javalite, while testing I came across a issue, where my library uses protobuf-javalite and Application uses protobuf-java. In this case, If I were to exclude protobuf-javalite, it results in java.lang.VerifyError: Verifier rejected class on google.protobuf.FloatValue.
Upon further investigating, i came across this issue
#2165
Is migrating to protobuf-javalite the only solution for this?
wu-hui commentedon Apr 27, 2023
It seems like you are depending on protobuf-java directly. In this case, what you could do is to pulling protobuf-java and rename its package. Not ideal, but if you really want to keep the protobuf to json feature, this is the only way I am aware of.
V-Abhilash-1999 commentedon Apr 28, 2023
Why is there a verify error when excluding protobuf-javalite in firebase? I am also facing a similar issue (if I am using FloatValue in my proto). How to avoid it?
HlebMaliborski commentedon Jan 3, 2025
Hi! Any update on this?
yurihondo commentedon Jun 26, 2026
Hi, I'm facing the same issue. Are there any updates on this?
dconeybe commentedon Oct 8, 2026
Update: Firebase Android BoM version 35.0.0 (released October 07, 2026) includes #8580 which upgrades the gRPC and protobuf dependencies to their latest versions. This may fix the problems reported in this issue. Please try upgrading and report your findings.