0
votes

I try to build a project,but...

Information:Gradle tasks [assembleDebug] D:\myGitHub\AndroidDemo\Demo\build\intermediates\res\merged\debug\values\values.xml Error:(719, 21) No resource found that matches the given name: attr 'preferenceTheme'. Error:(719, 21) No resource found that matches the given name: attr 'preferenceTheme'. Error:Execution failed for task ':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"
    ]
}

How can I solve this any solution? Thanks.

2

2 Answers

0
votes

Are you using this for a PreferenceFragment? If so, make sure you include the respective support lib.

https://developer.android.com/topic/libraries/support-library/packages.html#v7-preference

0
votes

Where do you use the attribute preferenceTheme ? According to the name , it seems that it should be in styles.xml but the IDE is trying to find it in values.xml. I guess that something is wrong with your code.