2

我不能夠建立我的項目,因爲我得到這個錯誤錯誤檢索父的項目:無資源發現在給定的名字相匹配「的Android版本:Widget.Material.Button.Colored」

Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. 
Error:(33) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. 
Error:Execution failed for task ':app:processStageDebugResources'. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/john/Library/Android/sdk/build-tools/22.0.1/aapt'' finished with non-zero exit value 1 
/Users/john/AndroidStudioProjects/app/build/intermediates/res/merged/stage/debug/values-v23/values-v23.xml 

這是我的build.gradle

android { 
def versionCodeValue = 1 
def versionNameValue = "1.0" 

compileSdkVersion 22 
buildToolsVersion "22.0.1" 

defaultConfig { 
    applicationId "com.sample.test" 
    minSdkVersion 17 
    targetSdkVersion 22 
    versionCode versionCodeValue 
    versionName versionNameValue 
} 
} 
dependencies { 
    def supportLibVersion = "22.2.1" 
    compile 'com.android.support:support-v4:' + supportLibVersion 
    compile 'com.android.support:design:' + supportLibVersion 
    compile 'com.android.support:appcompat-v7:' + supportLibVersion 
    compile 'com.android.support:cardview-v7:' + supportLibVersion 
    compile 'com.android.support:recyclerview-v7:' + supportLibVersion 
} 

我更新supportlibrary後出現此錯誤。我不想使用目標SDK 23.我不想在RuntimePermission的應用

這是我styles.xml

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> 
    <item name="colorPrimary">@color/colorPrimary</item> 
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item> 
    <item name="colorAccent">@color/colorPrimary</item> 
    <item name="android:windowBackground">@color/colorLightGrey</item> 
    <item name="android:textViewStyle">@style/myTextViewStyle</item> 
    <item name="android:buttonStyle">@style/myButtonStyle</item> 
    <item name="android:editTextStyle">@style/myEditTextStyle</item> 
</style> 

我不明白爲什麼它會顯示錯誤價值觀v23.xml,因爲我不使用版本23。它顯示了

/Users/john/AndroidStudioProjects/app/build/intermediates/res/merged/stage/debug/values-v23/values-v23.xml 

回答

1

改變你的活動樣式較老的一個。例如Theme.AppCompat.Light.DarkActionBar 可以幫助,並在同一時間改變AppCompatActivity到活動錯誤。

您可以在此對話框中選擇主題: enter image description here

+0

我已經包含在問題styles.xml。建議使用哪一個 – John

+0

我編輯了我的答案。 – wanglugao

相關問題