您的位置:首页 > 移动开发

Error retrieving parent for item: No resource found that matches the given name 'android:TextAppeara

2015-12-08 15:20 513 查看
这篇文章中 http://www.apkbus.com/android-246037-1-1.html?_dsign=361a7403,有一处地方也是关于这个报错,但是他的分析错误,这个报错和buildToolsVersion的版本没有关系

错误信息:

在clear Project 和rebuild Project 的时候,报以下错误:

Error retrieving parent for item: No resource found that matches the given name’android:TextAppearance.Material.Widget.Button.Inverse’.

Error:Execution failed for task ‘:app:processDebugResources’.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘d:\Android\sdk\build-tools\23.0.1\aapt.exe” finished with non-zero exit value 1

示例代码:

[code]apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.example.xx.myqr"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
//    compile 'com.android.support:appcompat-v7:19.+'
    compile 'com.android.support:appcompat-v7:23.0.1'
//    compile 'com.android.support:design:22.2.1'
}


错误原因:

compileSdkVersion 版本比support 版本低,没有发现Material Design的Theme

我的分析:

com.android.support:appcompat-v7:23.0.1库中没有包含这个Material 的部分资源(例如:Material.Widget.Button.Inverse),这些资源被包含在compileSdkVersion 23 ,但是在compileSdkVersion 22 中又没有,所以出现这样的错误

如果我的分析有误,还望高人相告

[code]compileSdkVersion 22 
改为
compileSdkVersion 23 

就可消除错误
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: