husnjak / IGDB-API-JVM

Wrapper for IGDBs API written in Kotlin should work for all JVM based languages, tested in Kotlin & Java
MIT License
37 stars 10 forks source link

Compile failure when used with Firebase Firestore #27

Open Prometheus3k opened 8 months ago

Prometheus3k commented 8 months ago

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:

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
cvalera18 commented 4 months ago

Same problem here