2017-08-11 69 views
0

我嘗試建立一個項目,但是......沒有資源發現在給定的名字相匹配,並且無法執行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" 
    ] 
} 

我怎樣才能解決這個任何解決方案?謝謝。

回答

0

你在哪裏使用屬性preferenceTheme?根據名稱,它似乎應該在styles.xml但IDE試圖找到它在values.xml。我猜你的代碼有問題。

+0

值文件夾下的所有資源,建成一個'values.xml'中間文件。這似乎不是問題。 –

相關問題