Gradle: Error retrieving parent for item: No resource found that matches the given name

编译失败:Gradle: Error retrieving parent for item: No resource found that matches the given name

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

一般遇到这种问题,先要锁定问题产生的位置。我们是在 make project 的过程中产生的报错,所以,肯定是跟编译的环境设置有些关系。一般去找找相关设置,看看是否有设置错的。比如:

    compileSdkVersion 23
    
    buildToolsVersion "23.0.3"
    
    compile 'com.android.support:appcompat-v7:23.3.0'
    

如果你用的是 intellij idea 开发 android,可能还得关注一下 java 的版本:

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_6
        targetCompatibility JavaVersion.VERSION_1_6
    }

这里说一下,这些配置最好都在 balabala.gradle 中手动改,不然通过 F4 打开 Project Structure 改的话,有时候会出现修改不成功的情况。(就是改了也无效,gradle 没有同步更新。)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容