Gradle build style attributes not found error

I tried to rollback my project to a previous version by checking out Git from GitHub, but I think I did it wrong. I just deleted my local project and checked the git url on android studio. However, Gradle fails to build and shows this message:

I go to the line that says the attr style was not found and select Find Usage, but it says there is no use in this project. I have also tried uninstalling the Twitter toolboxes and downloading it again and also downloading the older version, both still have this problem. How to fix it? gradle build wrong

The project is built with Android Studio 3.0 Canary from the start. this is the gradle app file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "..."
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 3
        versionName "beta1"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    testCompile 'junit:junit:4.12'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:26.0.0'
    compile 'com.android.support:recyclerview-v7:26.0.0'
    compile 'com.twitter.sdk.android:twitter:3.1.0'
    compile 'com.jakewharton:butterknife:8.7.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    annotationProcessor 'com.github.bumptech.glide:glide:3.7.0'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
    implementation 'com.android.support:appcompat-v7:26.0.0'
    implementation 'com.android.support:design:26.0.0'
}

      

And one more assembly file:

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha9'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

      

+9


source to share


3 answers


This is a problem with themes and styles. Probably one of your libraries expects this style to be available and it won't find it. See Here Cannot Set Android Action Bar Background Correctly as a guide to populating this particular attribute that might work for you.

This resource seems to have been introduced in 2013 according to google diff here https://android.googlesource.com/platform/tools/base/+/f5215ae4712f468568b58c20baadd14b769c10c4%5E!/



Change your themes. xml and then using it from the manifest, or modifying styles.xml can potentially cause these side effects if not done properly.

+4


source


Adding v7 library preference support dependency to Gradle solved the problem for me. It supports missing attributes for @ style / PreferenceThemeOverlay.

Place the following line in your build.gradle module:



com.android.support:preference-v7:27.1.1

+2


source


If you are using theme style with parent = "android: Theme.DeviceDefault" you should use

<item name="android:windowActionBar">false</item>

      

instead

<item name="windowActionBar">false</item>

      

Or change the theme style from "android: Theme.DeviceDefault" to "Theme.AppCompat.Light.DarkActionBar", this might solve some other style issues as well.

0


source







All Articles