Open beigirad opened 5 years ago
it's recommended to use protobuf-lite instead of protobuf
This is only true for Android and not the JVM. Our supplied protobuf converter works for both. We can add once sentence to the README for this, but it's not a bug.
Yes. That's required for android developers.
It's only recommended, not required. Regular protobuf works fine as well.
I'd like to note that while regular protobuf does work fine, you'll end up hitting duplicate class errors because of this when using other Android libraries that prefer protobuf-lite (we hit this with the Chromecast play services framework dependency). It would definitely be good to update the docs on this one.
As a developer who is newer to Android running into this issue was extremely confusing. Here is where I ended up:
implementation('com.squareup.retrofit2:converter-protobuf:2.9.0') {
exclude group: 'com.google.protobuf'
}
In protobuf documents it's recommended to use
protobuf-lite
instead ofprotobuf
But
protobuf-convertor
has a dependency forprotobuf
and when we addprotobuf-lite
to project, in building time occurred this duplicate error:and we should exclude default
protobuf
dependency fromprotobuf-convertor
like this:In my opinion it's a bug and requires description to prevent confusion among users.