Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protobuf-java not compatible with Android #22

Open
dakdroid opened this issue Oct 7, 2019 · 3 comments
Open

Protobuf-java not compatible with Android #22

dakdroid opened this issue Oct 7, 2019 · 3 comments

Comments

@dakdroid
Copy link

dakdroid commented Oct 7, 2019

Most Google libraries use protobuf-lite which isn't compatible with protobuf-java:

AGPBI: {"kind":"error","text":"Program type already present: com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream","sources":[{}],"tool":"R8"}

Libraries e.g.:
com.google.android.gms:play-services-cast-framework:17.1.0
com.google.firebase:firebase-config:19.0.2
com.google.android.datatransport:transport-backend-cct:2.0.1

@bubbleguuum
Copy link

It's specifically newer versions of firebase-config that cause this problem, because it adds a dependency on com.google.protobuf:protobuf-lite:3.0.1 which is incompatible with protobuf-java used by java-photoslibrary.

A workaround seems to exclude protobuf-lite from remote-config:

implementation ('com.google.firebase:firebase-config:19.0.2') {
        exclude group: 'com.google.protobuf', module:'protobuf-lite'
    }

I have not seen any side-effect on remote-config with this, although this is really band-aid.

@benju69
Copy link

benju69 commented Jun 25, 2020

Same issue here with firebase performance with the 1.5.0

@bubbleguuum
Copy link

bubbleguuum commented Sep 11, 2020

Still a problem to this day.

The workaround I mentioned in second post does not work: it will remove compilation errors caused by the duplicate protobuf classes, but firebase-config will does not work properly (fail to fetch values).

So you cannot use java-photoslibrary in conjunction with any library that needs com.google.protobuf:protobuf-javalite such as some firebase libraries. For remote-config, you can stay with older version 18.0.0, the last version that does not use protobuf-javalite.

Would be nice if a solution was found, for example by making this library compatible with protobuf-javalite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants