android - 在 Android Studio 上找不到资源支持 :appcompat-v7:22. 0.0 的错误

标签 android android-appcompat build.gradle

我正在尝试按照此指南添加设计支持库 https://github.com/codepath/android_guides/wiki/Design-Support-Library我遇到了问题。

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

尝试添加这个,它在构建时给了我很多 XML 错误。

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

这是下面的build.gradle

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'
}

最佳答案

文件名太长时出现此错误。

如果您在 Windows 下运行,您的 build/intermediates/... 文件可能会变得很长。如果发生这种情况,您将收到类似这样的奇怪错误。

关于android - 在 Android Studio 上找不到资源支持 :appcompat-v7:22. 0.0 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30943180/

相关文章:

gradle - 如何在gradle中为不同的sourceCompatibility和targetCompatibility构建项目

android-studio - com.android.tools.r8.a : MethodHandle. invoke 和 MethodHandle.invokeExact 仅从 Android O (--min-api 26) 开始支持

java - 编译 Android 应用程序时出错 - 任务 :app:transformClassesWithDexForDebug 执行失败

android - 如何绘制声波?

android - 奥利奥通知 - channel 不工作

java - appcompat 库的 src 文件夹中没有文件

android - CardView 在底部插入暗线

android - API Level 26 以下的 NDK 和 SDK 之间共享内存

android - 使用 TabLayout 时工具栏消失

Android DatePicker 颜色样式