Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Conflicts using in React Native project due to com.facebook.jni.DestructorThread #196

Open
priyanknitk opened this issue Jun 7, 2018 · 3 comments

Comments

@priyanknitk
Copy link

priyanknitk commented Jun 7, 2018

I'm working on a hybrid project which takes dependency on both react-native and conceal. In my gradle file I get the following error:

com.android.dex.DexException: Multiple dex files define Lcom/facebook/jni/DestructorThread;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
... 1 more

It looks like its because both React Native and Conceal use the same fully qualified package name, any ideas on how to sort this out? Maybe rename the package name in this project?

https://github.com/facebook/conceal/blob/master/first-party/fbjni/java/com/facebook/jni/DestructorThread.java

https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/jni/DestructorThread.java

Infact the issue is with whole com/facebook/jni package.

Also soloder is added as dependency in React-native, but added as source code in conceal, so even that is creating problems

@KarimFikani
Copy link

@priyanknitk I'm facing a similar issue when building I get the following error:

Program type already present: com.facebook.jni.HybridData$Destructor
Message{kind=ERROR, text=Program type already present: com.facebook.jni.HybridData$Destructor, sources=[Unknown source file], tool name=Optional.of(D8)}

Did you face a similar problem? If yes how did you solve it? It seems that there was an issue #102 and was supposed to be fixed but it's still happening.

@priyanknitk
Copy link
Author

@KarimFikani I don't think there is a workaround here. The right fix would be to change the package name for these classes in this project.

For now, I downgraded to 1.3 version of conceal. This issue was introduced in the latest version

@Kranthi94
Copy link

Any update on this..?

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

No branches or pull requests

3 participants