Jump to content

AAPT: error: duplicate value for resource on Android Studio


funbinod

Recommended Posts

Hello everyone!

I'm very new to JAVA coding and trying to make a simple app using Android Studio V4.1.2.

But when I try to debug my app, I encounter an unexpected error. I searched the web for the solution and tried almost everything (like changing gradle version, invalidating cache, etc) that was suggested for others, but my problem was not solved. So I'm here to ask for help.

Here are the environments I'm using.

build.gradle (app level)

plugins {
    id 'com.android.application'
}
apply plugin: 'com.google.gms.google-services'  // Google Services plugin
android {
    compileSdkVersion 30
    buildToolsVersion '23.0.1'

    defaultConfig {
        applicationId "app.samaya"
        minSdkVersion 21
        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 {
    implementation 'com.android.support:support-v4:30.0.0'
    implementation 'com.android.support:design:30.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.google.android.gms:play-services-location:18.0.0'
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
    implementation platform('com.google.firebase:firebase-bom:26.6.0')
    implementation 'com.google.firebase:firebase-messaging'
    implementation 'com.google.firebase:firebase-analytics'
}

build.gradle (project level)

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.2'
        classpath 'com.google.gms:google-services:4.3.5'  // Google Services plugin
    }
}
allprojects {
    repositories {
        google() // and here
        jcenter()
    }
}
apply plugin: 'com.android.application'

repositories {
    mavenCentral()
    maven { url 'https://maven.google.com' }
    jcenter()
}

android {
    compileSdkVersion 30
    buildToolsVersion '30.0.3'

    defaultConfig {
        applicationId 'app.samaya'
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

    }

    lintOptions {
        abortOnError false
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'

}

Syncing project with gradle file completes successfully but when I try to debug this, I get some error relating to a file in cache folder. Here is the screenshot of the error.

android-studio-error.png

I tried almost everything suggested on other forums. But remained unsolved. Please help me to resolve this problem.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...