转载请标明出处:http://blog.csdn.net/xx326664162/article/details/50218623 文章出自:薛瑄的博客
你也可以查看我的其他同类文章,也会让你有一定的收货!
这篇文章中 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
示例代码:
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 中又没有,所以出现这样的错误
如果我的分析有误,还望高人相告
compileSdkVersion 22
改为
compileSdkVersion 23
就可消除错误