0

I had this problem after updating com.android.tools.build:gradle from project to 2.3.0-beta1. If I set back to 2.2.3, the Theme.AppCompat style recognizes.

I don't want to set it to 2.2.3 because the project can't be out of time.

Here is the error's print:

enter image description here

My project's build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0-beta1'

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

allprojects {
    repositories {
        jcenter()
    }
}

My app's build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'
    defaultConfig {
        applicationId "com.xxxxxxx.xxxxxxx"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 76
        versionName "1.18.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    useLibrary 'org.apache.http.legacy'
}

buildscript {

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }

    repositories {

        maven {
            url 'https://maven.fabric.io/public'
        }

    }

}

repositories {

    maven {
        url "https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/"
    }

    maven {
        url 'https://maven.fabric.io/public'
    }

    flatDir {
        dirs 'libs'
    }

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile('de.keyboardsurfer.android.widget:crouton:1.8.5@aar') {
        exclude group: 'com.google.android', module: 'support-v4'
    }
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
    compile(name: 'libctfclient-sdk', ext: 'aar')

    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:support-v13:25.1.0'
    compile 'com.android.support:support-v4:25.1.0'
    compile 'com.android.support:design:25.1.0'

    compile 'com.github.gabrielemariotti.cards:library:1.8.0'
    compile 'com.github.gabrielemariotti.cards:library-extra:1.8.0'
    compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
    compile 'com.github.chrisbanes.actionbarpulltorefresh:library:0.9.9'
    compile 'com.embarkmobile:zxing-android-minimal:2.0.0@aar'
    compile 'com.embarkmobile:zxing-android-integration:2.0.0@aar'
    compile 'com.google.zxing:core:3.0.1'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.google.android.gms:play-services-analytics:9.8.0'
    compile 'com.github.nkzawa:socket.io-client:0.3.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
}

In order of that error, I have this problem:

enter image description here

I already tried:

  • Invalidate Caches\Restart;

  • Update android support library to the last version;

  • Clean and Rebuild the project;

Does anyone know how to solve this problem without setting project's build.gradle to 2.2.3?

Lennon Spirlandelli
  • 3,131
  • 5
  • 26
  • 51

4 Answers4

3

As said in this answer https://stackoverflow.com/a/42765120/3825764,

"build cache" is enabled by default in build Android Plugin since 2.3.0. It creates files in build cache outside of project folder (e.g. in \Users\%username%.android\build-cache). Theese files are intended to be common between your projects.

And then Android Studio is unable to navigate in theese files.

You can disable Build Cache in gradle.properties file. just add android.enableBuildCache=false

Community
  • 1
  • 1
1

I used android.tools.build:gradle:2.3.0-beta3 and had the same problem. I've upgraded Android Studio 2.2.3 to 2.3 beta 2 and everything had worked.

Cooki
  • 11
  • 2
0

File -> Invalidate Caches / Restart did not resolve the issue.

Preferences -> Build, Execution, Deployment -> Gradle showed Use local gradle distribution selected with Gradle home: /Applications/Android Studio.app/Contents/gradle/gradle-2.14.1 and a warning displayed saying the gradle location was incorrect.

Resolved issue by selecting Use default gradle wrapper (recommended). Probably just pointing to the new local distribution location would also work.

-1

Try: File -> "Invalidate Cashes\Restart"

Can be just problem of android studio

kristyna
  • 1,360
  • 2
  • 24
  • 41