facebookincubator / spectrum

A client-side image transcoding library.

Home Page:https://libspectrum.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate Some of Classes in FBJNI Library

opened this issue Β· comments

πŸ› Bug Report

Both com.facebook.flipper:flipper, com.facebook.spectrum use fbjni library, but spectrum include fbjin in library(not imple dependency)

To Reproduce

  1. Add depedencies
    com.facebook.flipper:flipper
    com.facebook.spectrum
  2. Sync and Build
  3. Get this Error Message
Duplicate class com.facebook.fbjni.BuildConfig found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.CppException found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.CppSystemErrorException found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.DestructorThread found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.DestructorThread$1 found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.DestructorThread$Destructor found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.DestructorThread$DestructorList found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.DestructorThread$DestructorStack found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.DestructorThread$Terminus found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.HybridClassBase found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.HybridData found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.HybridData$Destructor found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.IteratorHelper found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.MapIteratorHelper found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.NativeRunnable found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.ThreadScopeSupport found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.UnknownCppException found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)
Duplicate class com.facebook.jni.annotations.DoNotStrip found in modules jetified-fbjni-0.2.0-runtime.jar (com.facebook.fbjni:fbjni:0.2.0) and jetified-spectrum-fbjni-1.2.0-runtime.jar (com.facebook.spectrum:spectrum-fbjni:1.2.0)

Go to the documentation to learn how to Fix dependency resolution errors.

Environment

implementation "com.facebook.flipper🐬0.81.0"
implementation "com.facebook.soloader:soloader:0.10.1"
implementation "com.facebook.spectrum:spectrum-default:1.2.0"

Hi @robin-hood-daangn

Looks like this is a similar issue as in #186 Could you please take a look on the suggested solution there and then we can follow up?

If it doesn't help it would be great if you could share a simple project with those dependencies to reproduce it.

Duplicate of #186

Hi @robin-hood-daangn

Looks like this is a similar issue as in #186 Could you please take a look on the suggested solution there and then we can follow up?

If it doesn't help it would be great if you could share a simple project with those dependencies to reproduce it.

I think the issue's solution as in #186 avoids the root cause and solves it in a different way.
I also can solve the problem like #186, but I think you can change the FBJNI Library as in sourceCode to it