Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No resource found Errors for support:appcompat-v7:22.0.0 on Android Studio

Am trying to add the Design support Library following this guidelines https://github.com/codepath/android_guides/wiki/Design-Support-Library and i'm having issues.

dependencies {
          compile 'com.android.support:appcompat-v7:22.2.0'
} 

Trying to add this and Its giving me lots of XML errors when building.

Error:(24, 63) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_textfield_default_mtrl_alpha').
Error:(25, 93) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_textfield_default_mtrl_alpha').
Error:(26, 33) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_textfield_activated_mtrl_alpha').

Error:(20, 118) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_selector_disabled_holo_dark').
Error:(21, 118) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_selector_disabled_holo_dark').
Error:(20, 118) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_selector_disabled_holo_light').
Error:(21, 118) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_selector_disabled_holo_light').

Error:(18, 29) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_pressed_holo_light').
Error:(22, 118) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_selector_disabled_holo_dark').
Error:(23, 118) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_selector_disabled_holo_dark').

Error:(22, 118) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_selector_disabled_holo_light').
Error:(23, 118) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_list_selector_disabled_holo_light').
Error:(19, 27) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_btn_rating_star_off_mtrl_alpha').
Error:(21, 27) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_btn_rating_star_off_mtrl_alpha').

Error:(23, 27) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_btn_rating_star_on_mtrl_alpha').
Error:(19, 29) No resource found that matches the given name (at 'drawable' with value '@drawable/abc_btn_switch_to_on_mtrl_00001').

Information:BUILD FAILED

This is the build.gradle below

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.example.hp.navigationexercise"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

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

    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.android.support:support-annotations:22.2.0'
    compile 'com.android.support:design:22.2.0'
    compile 'com.android.support:recyclerview-v7:22.2.0'
}
like image 622
Tosin Onikute Avatar asked Jun 19 '15 16:06

Tosin Onikute


3 Answers

I got this error when the filename was too long.

If you are running under windows, your build/intermediates/... files can get very long. You will get an odd error like this one if that happens.

like image 114
Brian Donovan-Smith Avatar answered Nov 18 '22 22:11

Brian Donovan-Smith


I solved this by adding multiDexEnabled true in defaultConfig in gradle file.

And by adding

 dexOptions {
        javaMaxHeapSize "4g"
    }

after defaultConfig.

like image 2
Abhishek Balani Avatar answered Nov 18 '22 21:11

Abhishek Balani


Since I ran into the same problem and there is no complete answer, I'll post it.

As @Brian Donovan-Smith mentioned, the problem occurs when one or more file names is too long (more than 260 characters). It is worth to note that the name includes the entire path. So, that was the problem in my case, and I solved it by moving the source folders to a closer to C: location.

like image 1
Ari Avatar answered Nov 18 '22 21:11

Ari