Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Protobuf-java not compatible with Android #22

Description

@dakdroid

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

Activity

  1. bubbleguuum commented on Oct 13, 2019

    @bubbleguuum

    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.

  2. benju69 commented on Jun 25, 2020

    @benju69

    Same issue here with firebase performance with the 1.5.0

  3. bubbleguuum commented on Sep 11, 2020

    @bubbleguuum

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions