I am writing a student project, there is a need for a chronos library. Got an error. The direct answer is not googled.

My steps are in order.

I'm trying to connect the chronos library:

implementation 'com.redmadrobot:chronos:1.0.7' 

https://github.com/RedMadRobot/Chronos

I receive:

 Program type already present: org.intellij.lang.annotations.JdkConstants$PatternFlags 

Google docks.

I find: https://developer.android.com/studio/build/dependencies#duplicate_classes

Specifically:

This error typically occurs due to one of the following circumstances:

1) A binary dependency for your direct dependency. For example, your app declares a library code.

Remove Library B as a direct dependency.

2) Your app has a local binary file dependency.

To resolve this issue, remove one of the binary dependencies.

I understand that my point is the first. OK.

Go to the chronos sources, and see the package there:

 org.intellij.lang.annotations 

OK. Disable it at compile time and that's it. We write:

 implementation ('com.redmadrobot:chronos:1.0.7') { exclude module: 'org.intellij.lang.annotations' } 

Does not help. Ok, turn off the problem point at the project level.

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

Does not help. Bye finish. What am I doing wrong?

app.gradle module at the moment:

 apply plugin: 'com.android.application' android { compileSdkVersion 28 defaultConfig { applicationId "com.it.ru.test" minSdkVersion 16 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.1.3' implementation 'com.android.support:design:28.0.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' implementation 'com.github.bumptech.glide:glide:4.8.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0' implementation 'com.squareup.retrofit2:retrofit:2.4.0' implementation 'com.squareup.retrofit2:converter-gson:2.4.0' implementation 'com.muddzdev:styleabletoast:2.2.0' implementation 'com.patrickpissurno:ripple-effect:1.3.1' implementation 'com.nononsenseapps:filepicker:4.1.0' implementation 'com.yarolegovich:discrete-scrollview:1.4.9' implementation 'com.azoft.carousellayoutmanager:carousel:1.2.4' implementation 'com.squareup.okhttp3:logging-interceptor:3.8.0' implementation 'com.gtomato.android.library:carouselview:2.0.1' implementation 'com.beloo.widget:ChipsLayoutManager:0.3.7@aar' implementation 'com.robertlevonyan.view:MaterialChipView:1.2.5' implementation 'com.xiaofeng.android:flowlayoutmanager:1.2.3.2' implementation 'com.github.pchmn:MaterialChipsInput:1.0.8' implementation 'jp.wasabeef:recyclerview-animators:2.3.0' implementation 'org.jetbrains:annotations-java5:15.0' implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2' implementation 'com.github.chuross:expandable-layout:1.0.5' implementation 'com.codesgood:justifiedtextview:1.1.0' implementation ('com.redmadrobot:chronos:1.0.7') { exclude module: 'org.intellij.lang.annotations' } } 

Project level:

 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() jcenter() maven { url "http://dl.bintray.com/lukaville/maven" } } dependencies { classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.google.gms:google-services:4.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() maven { url "https://jitpack.io" } } } task clean(type: Delete) { delete rootProject.buildDir } configurations { cleanedAnnotations compile.exclude group: 'org.intellij.lang' , module:'annotations' } 
  • And try inserting configurations { ... at the gradle app level gradle app the project level ( stackoverflow.com/a/49981467 ), and remove the exclude module: 'org.intellij.lang.annotations' . - iFr0z
  • Tried, did not help. - KirstenLy

0