Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate values issue in Android Studio gradle

I have been trying to add a dependency of com.shamanland:fonticon:0.1.8 but as I add this I get the error

error: duplicate value for resource 'attr/textSize' with config ''. error: resource previously defined here.

There are too many values with duplication issue to remove the values. I have tried changing compileSdkVersion and targetSdkVersion to 25 but this did not help either. I tried to use exclude but I don't know what to exclude exactly. Can anyone help me with this issue? Thank you.

My gradle:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
configurations {
    all*.exclude module: 'okhttp'
    all*.exclude module: 'okio'
}
compileSdkVersion 27
buildToolsVersion '27.0.2'
defaultConfig {
    applicationId "com.abc.def"
    vectorDrawables.useSupportLibrary = true
    minSdkVersion 17
    targetSdkVersion 27
    versionCode 15
    versionName "1.2.4"
    multiDexEnabled = true

}
buildTypes {
    release {
        lintOptions {
            disable 'MissingTranslation'
            checkReleaseBuilds false
        }
        minifyEnabled false
    }
}
aaptOptions {
    cruncherEnabled = false
}
dexOptions {
    javaMaxHeapSize "2g"
}
}
repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:design:27.0.2'
    compile 'com.android.support:appcompat-v7:27.0.2'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:percent:27.0.2'
    compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    compile 'com.jakewharton:butterknife:8.5.1'
    compile 'com.google.code.gson:gson:2.6.2'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.android.support:recyclerview-v7:27.0.2'
    compile 'com.android.support:cardview-v7:27.0.2'
    provided 'org.projectlombok:lombok:1.16.16'
    compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.8'
    annotationProcessor "org.projectlombok:lombok:1.16.16"
    compile 'com.google.android.gms:play-services-maps:11.0.1'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.6.0'
    compile 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.0'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.4.+'
    compile 'com.mikhaellopez:circularimageview:3.0.2'
    compile 'com.wdullaer:materialdatetimepicker:3.2.2'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.jd-alexander:library:1.1.0'
    compile 'com.google.android.gms:play-services-location:11.0.1'
    compile 'com.google.android.gms:play-services-maps:11.0.1'
    compile 'com.yarolegovich:discrete-scrollview:1.2.0'
    compile 'com.miguelcatalan:materialsearchview:1.4.0'
    compile 'com.wang.avi:library:2.1.3'
    compile 'com.google.firebase:firebase-core:11.0.1'
    compile 'com.google.firebase:firebase-messaging:11.0.1'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.github.ksoichiro:android-observablescrollview:1.5.0'
    compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
    compile 'com.hedgehog.ratingbar:app:1.1.2'
    compile 'com.eftimoff:android-pathview:1.0.8@aar'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    compile 'uk.co.chrisjenx:calligraphy:2.3.0'
    apply plugin: 'com.google.gms.google-services'
    compile 'com.stone.vega.library:VegaLayoutManager:1.0.1'
    compile project(':library')
    compile 'me.henrytao:smooth-app-bar-layout:24.1.0.0'
    compile project(':PayTabs_SDK')

    /*----------------payfort sdk------------*/

    implementation 'com.victor:lib:1.0.1'
    implementation 'com.shamanland:fonticon:0.1.8'
    implementation('com.nispok:snackbar:2.11.+') {
        // exclusion is not necessary, but generally a good idea.
        exclude group: 'com.google.android', module: 'support-v7'
    }
    implementation 'com.google.guava:guava:18.0'
    implementation 'org.bouncycastle:bcprov-jdk16:1.46'
    implementation 'commons-codec:commons-codec:1.10'

    implementation project(':FORTSDKv1.4.4')

}
like image 550
Mandip Giri Avatar asked May 13 '26 18:05

Mandip Giri


1 Answers

It may be due to the implementation of other external dependency. In my case, I try removing the external dependency one by one. Most Probably while adding dependency the same dependency was used on other external dependency. So try removing library dependency one by one and see which was causing problem.

like image 136
sanjay maharjan Avatar answered May 16 '26 06:05

sanjay maharjan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!