mpetazzoni / ttorrent

BitTorrent Java library with tracker and download client
http://mpetazzoni.github.com/ttorrent/
Apache License 2.0
1.38k stars 502 forks source link

Gradle #251

Closed EArminjon closed 4 years ago

EArminjon commented 4 years ago

Hi,

The following implementation in my app/build.gradle do not work :

dependencies {
     implementation "com.github.mpetazzoni:ttorrent:ttorrent-2.0"
}

in my root build gradle :

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
    }
}

Logs :

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not find net.sf:jargs:1.0.
     Required by:
         project :app > com.github.mpetazzoni.ttorrent:ttorrent-bencoding:ttorrent-2.0
         project :app > com.github.mpetazzoni.ttorrent:ttorrent-cli:ttorrent-2.0
         project :app > com.github.mpetazzoni.ttorrent:ttorrent-client:ttorrent-2.0
         project :app > com.github.mpetazzoni.ttorrent:ttorrent-common:ttorrent-2.0
         project :app > com.github.mpetazzoni.ttorrent:ttorrent-network:ttorrent-2.0
         project :app > com.github.mpetazzoni.ttorrent:ttorrent-test-api:ttorrent-2.0
         project :app > com.github.mpetazzoni.ttorrent:ttorrent-tests:ttorrent-2.0
         project :app > com.github.mpetazzoni.ttorrent:ttorrent-tracker:ttorrent-2.0

I use gradle 3.5.0, can you help me please :) ?

EArminjon commented 4 years ago

I updated my root build gradle to :

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
        maven { url 'https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/' }
    }
}

But now my logs :

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class org.intellij.lang.annotations.Flow found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.Language found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.MagicConstant found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.Pattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.PrintFormat found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.RegExp found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.intellij.lang.annotations.Subst found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.jetbrains.annotations.Contract found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.jetbrains.annotations.Nls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.jetbrains.annotations.NonNls found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.jetbrains.annotations.NotNull found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.jetbrains.annotations.Nullable found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.jetbrains.annotations.PropertyKey found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)
  Duplicate class org.jetbrains.annotations.TestOnly found in modules annotations-13.0.jar (org.jetbrains:annotations:13.0) and annotations-java5-19.0.0.jar (org.jetbrains:annotations-java5:19.0.0)

  Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
Exception: Gradle task assembleDebug failed with exit code 1

@Dead-off Can you help :) ?

EArminjon commented 4 years ago

Fixed my issue by adding :

app/build.grade

configurations {
        cleanedAnnotations
        compile.exclude group: 'org.jetbrains', module: 'annotations'
    }

Thx https://stackoverflow.com/questions/58903820/java-lang-runtimeexception-duplicate-class-org-intellij-lang-annotations-flow-f