husnjak/IGDB-API-JVM

Compile failure when used with Firebase Firestore

Opened this issue · 1 comments

I see there is an issue when you combine this library with firebase (bom 31.5.0 but happens with various newer/older versions of firebase bom).

This library uses protobuf (whether you use it or not) and firebase uses protobuf too. But quite some time ago they made changes to use protobuf-javalite (I think). In any case you cannot mix protobuf-java with protobuf-javalite hence the compile error when merging dependencies.
I'm not using the protobuf parts of this wrapper but this library depends on it.

Here are the posts describing the issue

Suggestions:

  • Upgrade protobuf usage to play nice with firestore
  • separate json and protobuf into optional packages so we import igdb-core and igdb-json or igdb-proto

Steps to repro:

  1. create a project, import firebase bom and firestore
  2. Import this IGDB wrapper (1.1.0)

Build and observe compile errors (there are two)

> Task :app:mergeDebugJavaResource FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
......

(See attached for full logs of the above... it's a lot!) log_1.txt

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'google/protobuf/field_mask.proto' from inputs:
      - /Users/username/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protobuf-java/3.24.3/8e0f08a59c21e3f17121667489a005a8df091af0/protobuf-java-3.24.3.jar
      - /Users/username/.gradle/caches/modules-2/files-2.1/com.google.protobuf/protobuf-javalite/3.21.7/82b692be08383107fd1c6d44474b56df411edd27/protobuf-javalite-3.21.7.jar

Same problem here