facebookarchive / android-jsc

Scripts for building JSC for Android
Other
255 stars 38 forks source link

jsc:r174650 has "duplicate entry: javax/annotation/Nullable.class" when react android 0.15.0 #10

Closed yipengmu closed 8 years ago

yipengmu commented 8 years ago

org.webkit.android-jsc.version=r174650

a problem attach to me when i use react native android 0.15.0:

duplicate entry: javax/annotation/Nullable.class

in abjectively case , another maven GAV also has Nullable which the package is also javax.annotation. even i can exclude an dependence a GAV ,bug i can't exclude all the files in an exist package,opps!

seem to https://github.com/johncarl81/parceler/issues/13

can @kmagiera @mkonicek help me and tell me how to sovle it.

yipengmu commented 8 years ago

@kmagiera can you tell me how to sovle it , by use a new jsc version ? thks

kmagiera commented 8 years ago

@yipengmu would you be able to restructure your question. I don't understand what your problem is all about. Also don't know what you refer to as "GAV"

mkonicek commented 8 years ago

Does the app crash with "duplicate entry: javax/annotation/Nullable.class"? Or is it just a warning you see in logcat?

yipengmu commented 8 years ago

thanks @kmagiera and @mkonicek and sorry for my bad description.

  1. for @kmagiera , "GAV" I refer to the "groupId artifactId version" for an unique dependency of maven or gradle.
  2. for @mkonicek ,it's not crash in runtime but in compile in gradle ,i depence an another library also has the same java pageckagepath+class .

see source code :

https://github.com/yipengmu/react-native-android-lession/blob/master/pics/jsc-bug.png

see compile error : https://github.com/yipengmu/react-native-android-lession/blob/master/pics/nullable%20duplication.png i

this issue also occur in https://github.com/johncarl81/parceler/issues/13

happy to see that all the annotation java class should be located to it's good packagepath in jsc library

kmagiera commented 8 years ago

I think you mistaken this package for JSR, which is something completely different than JSC. This library doesn't contain any Java code nor Java dependencies so it shouldn't be possible for it to cause any conflicts on Java compile level

yipengmu commented 8 years ago

thanks @kmagiera for help me to solve this .

but i see the jar content, it is really java Class Named Nullable.java located in the javax.*, like the screenshot below

https://github.com/yipengmu/react-native-android-lession/blob/master/pics/jsc-bug.png

kmagiera commented 8 years ago

@yipengmu yes, cause you're looking at the content of jsr305 jar (jsr305-3.0.0.jar) whereas this library is called "android-jsc" and the AAR file it provides is called "android-jsc-r174650.aar"

yipengmu commented 8 years ago

@kmagiera yes,it is cause by "jsr305",

in gradle ,i use below config, it can success. thank you very much @kmagiera @mkonicek exclude group: 'com.google.code.findbugs', module: 'jsr305'