Failed to compile values file while merging resources (Duplicate values in files from two different dependencies

Viewed 170

I had downloaded an old android project from GitHub after resolving all the issues that were present in it and finding ways to import all the dependencies in build.gradle, I get the following error(s).

> Task :app:mergeDebugResources
C:\Users\admin\.gradle\caches\transforms-2\files-2.1\7160c6b9fdb2bc1e41d9bd715d01fdc2\appcompat-1.3.0\res\values\values.xml:1711:4: Duplicate value for resource 'attr/background' with config 'DEFAULT' and product ''. Resource was previously defined here: C:\Users\admin\.gradle\caches\transforms-2\files-2.1\413908c8957c32f488ee44857e65d202\jetified-actionbarsherlock-4.4.0\res\values\values.xml:5:4: .
C:\Users\admin\.gradle\caches\transforms-2\files-2.1\413908c8957c32f488ee44857e65d202\jetified-actionbarsherlock-4.4.0\res\values\values.xml:27:4: Duplicate value for resource 'attr/navigationMode' with config 'DEFAULT' and product ''. Resource was previously defined here: C:\Users\admin\.gradle\caches\transforms-2\files-2.1\7160c6b9fdb2bc1e41d9bd715d01fdc2\appcompat-1.3.0\res\values\values.xml:1711:4: .
C:\Users\admin\.gradle\caches\transforms-2\files-2.1\413908c8957c32f488ee44857e65d202\jetified-actionbarsherlock-4.4.0\res\values\values.xml:232:4: Duplicate value for resource 'attr/itemBackground' with config 'DEFAULT' and product ''. Resource was previously defined here: C:\Users\admin\.gradle\caches\transforms-2\files-2.1\2730d74d200c17936a122ce975a9aa70\material-1.3.0\res\values\values.xml:3634:4: .
C:\Users\admin\.gradle\caches\transforms-2\files-2.1\413908c8957c32f488ee44857e65d202\jetified-actionbarsherlock-4.4.0\res\values\values.xml:296:4: Duplicate value for resource 'attr/actionBarSize' with config 'DEFAULT' and product ''. Resource was previously defined here: C:\Users\admin\.gradle\caches\transforms-2\files-2.1\7160c6b9fdb2bc1e41d9bd715d01fdc2\appcompat-1.3.0\res\values\values.xml:1979:4: .

> Task :app:mergeDebugResources FAILED
Execution failed for task ':app:mergeDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
   > Resource compilation failed. Check logs for details.

* 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.

Can someone please help me resolve this issue?

Here is my build.gradle file (:app),

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.example.madmicroproject"
        minSdkVersion 18
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    def multidex_version = "2.0.1"
    implementation "androidx.multidex:multidex:$multidex_version"
    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    testImplementation 'junit:junit:4.13.2'
    implementation "commons-io:commons-io:2.9.0"
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    implementation 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    implementation group: 'eu.chainfire', name: 'libsuperuser', version: '1.1.0.202004101746'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.android.volley:volley:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

Please let me know if any more information is needed.

0 Answers
Related