Gradle building doesn't find attr style

327 Views Asked by At

Recently I had an error, But the worse part is: I've done nothing!
When the project builds all the gradle files, I receive this error log:

Error:(3, 6) No resource found that matches the given name: attr 'style'.

Error:(3, 6) Execution failed for task ':hiperCotacao:processDebugResources'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Development\java-dev\sdk\build-tools\21.0.2\aapt.exe package -f --no-crunch -I C:\Development\java-dev\sdk\platforms\android-21\android.jar -M C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\manifests\full\debug\AndroidManifest.xml -S C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\res\debug -A C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\assets\debug -m -J C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\generated\source\r\debug -F C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\res\resources-debug.ap_ --debug-mode --custom-package trilha.hipercot.activities -0 apk --output-text-symbols C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\symbols\debug Error Code: 1 Output: C:\Development\java-dev\projects\HiperCotacao\hiperCotacao\build\intermediates\res\debug\values\values.xml:1431: error: Error: No resource found that matches the given name: attr 'style'.

I'm Using:

Android Studio 1.0 RC 1
Build-tools v21.1.1
Min SDK Ver: 8
Target SDK Ver: 21
Using support-appcompat v4, v7. And also RecyclerView, CardView (All Maven resources)
Gradle Version: 2.1
Android Plugin Version: 0.14.4

And here is the 'build.gradle' file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion '21.1.1'

    defaultConfig {
        applicationId "trilha.hipercot.activities"
        minSdkVersion 8
        targetSdkVersion 21
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(':recyclerviewstickysection')
    compile project(':androidsupportv4preferencefragment')
    compile files('libs/ormlite-android-4.48.jar')
    compile files('libs/ormlite-core-4.48.jar')
    compile 'com.android.support:support-v4:21.0.2'
    compile 'com.android.support:appcompat-v7:21.0.2'
    compile 'com.android.support:recyclerview-v7:21.0.2'
    compile 'com.android.support:cardview-v7:21.0.2'
}

The error points to:

<style name="Theme.HiperCotacao" parent="@style/Theme.AppCompat.Light">
    //...
</style>



EDIT

Problem Solved It was a line on my "styles.xml". Something like that:

<item name="style">?attr/selectableItemBackground"</item>

The curious part is: It wasn't poiting to the right part of the problem. And then after:

<item name="android:foreground">?attr/selectableItemBackground</item>
1

There are 1 best solutions below

0
On

You can't use a style within a style. Another solution could be to add the other style as a parent.