1. 程式人生 > >解決Android中No resource found that matches android:TextAppearance.Material.Widget.Button.Inverse問題

解決Android中No resource found that matches android:TextAppearance.Material.Widget.Button.Inverse問題

article 需要 技術分享 ppc def lac hat adl repl

如果在剛夠構建Android Studio項目的時候,運行發現,出現沒找到資源的錯誤!找不到com.android.support/appcompat-v7/23.0.1/res/values-v23/values-v23.xml

[html] view plain copy
  1. /路徑/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-v23/values-v23.xml
  2. Error:Error retrieving parent for item: No resource found that matches the given name ‘android:TextAppearance.Material.Widget.Button.Inverse‘.
  3. Error:Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Button.Colored‘.

這是API 23(Android 6.0)中的資源文件,而查看build.gradle,編譯的SDK只是為21,我們可以嘗試將compileSdkVersion設為23(如果sdk裏面沒有下載API 23的,則需要下載),問題解決!

如果不想下載API 23怎麽解決呢?降低appcompat的版本:將build.gradle裏面的dependencies對應的appcompat版本降低:

技術分享

將compile ‘com.android.support:appcompat-v7:23.0.1‘的版本改為:‘com.android.support:appcompat-v7:22.2.1‘

解決Android中No resource found that matches android:TextAppearance.Material.Widget.Button.Inverse問題