2015-12-12 30 views
0

我的Android Studio工作正常。但是,当我尝试使用主 - 细节流布局创建新项目时,我得到了这些错误。
现在我创建的任何项目都给了我相同的错误。错误:(1)检索父项的错误:找不到与给定名称匹配的资源'android:TextAppearance.Material.Widget.Button.Inverse'

C:\Users\Lucas\Documents\PopularMovies2\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\values-v23\values-v23.xml 
Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. 
Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. 

我该怎么办?

这里的摇篮文件:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 22 
    buildToolsVersion "22.0.1" 

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

repositories { 
    mavenCentral() 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile 'com.android.support:support-v4:23.1.1' 
} 

感谢。

回答

1

如果您在使用图书馆com.android.support:appcompat-v7:23.1.1com.android.support:support-v4:23.1.1,尝试使用buildToolsVersioncompileSdkVersiontargetSdkVersion = 23:

... 
compileSdkVersion 23 
buildToolsVersion "23.0.1" 

defaultConfig { 
    applicationId "com.example.lucas.popularmovies2" 
    minSdkVersion 10 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
... 

此外,您还可以更改程序兼容性版本回22.2.1以下

1

您的问题是你编译compileSdkVersion 22,但支持库需要版本23作为你的gradle文件。支持库使用sdk版本。因此,v4:23表示compileSdkVersion 23.因此,在gradle compileSdkVersion 22中更改为compileSdkVersion 23

相关问题