Android Build AAPT error: style attribute ‘attr/colorPrimary’ not found

  • by

I recently encountered an error on my newly build Android project which was saying:

AAPT: error: style attribute ‘attr/colorPrimary’ not found

Somehow while creating project it missed appcompat implementation in build.gradle(app)
implementation ‘’

After adding this implementation my project worked fine. Also please be sure you are using the right version of appcompat for your project.

My build.gradle (after adding implementation in the dependencies)
build.gradle (app):

apply plugin: ''

android {
    compileSdkVersion 28
    buildToolsVersion "29.0.0"

    defaultConfig {
        applicationId "parallelcodes.csvreader"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    buildTypes {
       release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), ''


dependencies {
    implementation ''
    implementation fileTree(dir: 'libs', include: ['*.jar'])


Thank You.