今天剛遇到的這個問題.
一:如果在剛夠構建Android Studio項目的時候,運行發現,出現沒找到資源的錯誤!找不到com.android.support/appcompat-v7/23.0.1/res/values-v23/values-v23.xml
<span style="font-family:Microsoft YaHei;font-size:14px;"> /路徑/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-v23/values-v23.xml
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. </span>
這是API 23(Android 6.0)中的資源文件,而查看build.gradle,編譯的SDK只是爲21,我們可以嘗試將compileSdkVersion設爲23,問題就解決了
二:如果不想下載API 23怎麼解決呢?降低appcompat的版本:將build.gradle裏面的dependencies對應的appcompat版本降低:
<span style="font-family:Microsoft YaHei;font-size:14px;">dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
}</span>
將compile 'com.android.support:appcompat-v7:23.0.1'的版本改爲:'com.android.support:appcompat-v7:22.2.1',就OK了