Retrofit: Does retrofit support protobuf-lite?

Created on 25 May 2017  路  4Comments  路  Source: square/retrofit

What kind of issue is this?

  • [x] Question. This issue tracker is not the place for questions. If you want to ask how to do
    something, or to understand why something isn't working the way you expect it to, use Stack
    Overflow. https://stackoverflow.com/questions/tagged/retrofit

  • [ ] Bug report. If you鈥檝e found a bug, spend the time to write a failing test. Bugs with tests
    get fixed. Here鈥檚 an example: https://gist.github.com/swankjesse/6608b4713ad80988cdc9

  • [ ] Feature Request. Start by telling us what problem you鈥檙e trying to solve. Often a solution
    already exists! Don鈥檛 send pull requests to implement new features without first getting our
    support. Sometimes we leave features out on purpose to keep the project small.

Most helpful comment

Use your build system to exclude the converter's transitive dependency on protobuf and replace it with a dependency on protobuf-lite.

All 4 comments

In my case, I had to use both retrofit and protobuf-lite in the same time, but compile 'com.squareup.retrofit2:converter-protobuf:2.3.0' will download protobuf 3.0.0 as well, this will make me get
(Duplicate zip entry [com/a/a/a$a.class == protobuf-java-3.0.0.jar:com/google/protobuf/AbstractMessageLite$Builder.class])) error. How can I fix this?

Use your build system to exclude the converter's transitive dependency on protobuf and replace it with a dependency on protobuf-lite.

Would it make sense to make Protobuf converter depend on protobuf-lite instead of protobuf-java or is this intentionally optimized for consumers who use protobuf-java?

The converters are very simple. If you want a proto variant we don't offer, just fork the current one and include your own in your app.

All of the .proto implementations have trade-offs. I like Wire.

Was this page helpful?
0 / 5 - 0 ratings