How to eliminate duplicate duplicate input: javax / annotation / Parameters AreNullableByDefault.class

I am new to Gradle and Android Studio build system and cannot figure out how to solve this problem. My build does not work:

* What went wrong: Execution failed for task ':cyanEngine:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: javax/annotation/ParametersAreNullableByDefault.class 

If I do Ctrl + N and search for ParametersAreNullableByDefault. One link points to External Libraries | jsr305-1.3.9 . Another points to classes.jar in xwalk_core_library .

xwalk_core_library is referenced in my xwalk_cordova module with:

 { android{ dependencies{ compile 'org.xwalk:xwalk_core_library:11.40.277.7' } } 

And my Gradle apps have:

 compile project (':xwalk_cordova') 

It seems I need to get rid of the External Library, but I'm not sure where it comes from.

Any pointers on how to resolve this?

Update: I realized that the external link comes from Guava, which is referenced in the build.gradle application via compile ('com.google.guava:guava:11.0.2') . Just upgrading to version 18.0 of Guava seems to have forced me to bypass this for now. Guess that the new version is no longer dependent on jsr.

Nevertheless, I feel that I will face this again. Basically, we had two third-party libraries depending on the same library. What is the best way to clear this?

I noticed that there is an exception for robolectic, I assume for similar reasons:

 testCompile('org.robolectric:robolectric:3.0-rc2') { exclude group: 'commons-logging', module: 'commons-logging' exclude group: 'org.apache.httpcomponents', module: 'httpclient' } 

I am wondering how this expression works and does not quite understand the Gradle docs. What does this statement say? Where does the "group" and the "module" come from?

+6
source share

Source: https://habr.com/ru/post/985556/


All Articles