2015-12-12 29 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

相關問題