0

i was building an app and everything worked fine and then i had to restart my computer and when i try to build the app again it shows an error saying

resource style/Theme.AppCompat.Light.DarkActionBar (aka com.solutions.frontier.inventorymanager:style/Theme.AppCompat.Light.DarkActionBar) not found.   
failed linking references.  

C:/Users/Surafel/.gradle/caches/transforms-1/files-1.1/support-compat-27.0.2.aar/ff928148892ded877e4d915a2e50e2e1/res/values/values.xml 
error: style attribute 'attr/colorPrimary (aka com.solutions.frontier.inventorymanager:attr/colorPrimary)' not found.   
error: style attribute 'attr/colorPrimaryDark (aka com.solutions.frontier.inventorymanager:attr/colorPrimaryDark)' not found.   
error: style attribute 'attr/colorAccent (aka com.solutions.frontier.inventorymanager:attr/colorAccent)' not found. 

and every reference of R.id.something is in red error: cannot resolve symbol R

it also says AAPT2 error

heres my build.gradle file just in case its needed

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.solutions.frontier.inventorymanager"
        minSdkVersion 16
        targetSdkVersion 27
        versionCode 1
        versionName "rand1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:support-v4:27.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

i tried cleaning the project and rebuilding it but it doesnt work

InsaneCat
  • 2,115
  • 5
  • 21
  • 40
Jhon
  • 99
  • 3
  • 15

1 Answers1

0

I have faced this error multiple times, i still don't know what is the exact solution, try these 1- change your project's build tools version. it's better to upgrade rather than downgrade. 2- go back step by step in your code, it seems you are running test with espersso go remove it and try again 3- change the library versions in your apps build.gradle file

Ed71
  • 11
  • 2