我嘗試建立一個項目,但是......沒有資源發現在給定的名字相匹配,並且無法執行AAPT
信息:搖籃任務[assembleDebug] d:\ myGitHub \ AndroidDemo \演示\建立\中間體\ res \ merged \ debug \ values \ values.xml 錯誤:(719,21)找不到與給定名稱匹配的資源:attr'preferenceTheme'。 錯誤:(719,21)找不到與給定名稱匹配的資源:attr'preferenceTheme'。 錯誤:執行失敗的任務':Demo:processDebugResources'。
com.android.ide.common.process.ProcessException: Failed to execute aapt Information:BUILD FAILED Information:Total time: 1.655 secs Information:3 errors Information:0 warnings Information:See complete output in console
def conf = rootProject.ext.version
def libs = rootProject.ext.dependencies
android {
compileSdkVersion conf.compileSdkVersion
buildToolsVersion conf.buildToolsVersion
defaultConfig {
applicationId "com.surcreak.androiddemo"
minSdkVersion conf.minSdkVersion
targetSdkVersion conf.targetSdkVersion
versionCode conf.versionCode
versionName conf.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
ext {
version = [
compileSdkVersion : 26,
buildToolsVersion : "26.0.1",
minSdkVersion : 19,
targetSdkVersion : 26,
versionCode : 1,
versionName : "1.0"
]
dependencies = [
"appcompat-v7" : "com.android.support:appcompat-v7:26.+",
"recyclerview" : "com.android.support:recyclerview-v7:26.+",
"constraint-layout" : "com.android.support.constraint:constraint-layout:1.0.2",
"dexter" : "com.karumi:dexter:4.1.0"
]
}
我怎樣才能解決這個任何解決方案?謝謝。
是的。我忘了添加「com.android.support:preference-v7:26.+」。謝謝。 – user3059882