輝き しんや
輝き しんや

Reputation: 45

Android resource compilation failed (cache file error )

i'm not able to build my project anymore and I'm getting some error regarding one of the catch files and specifically it takes me to a value called:layoutCron

i took some screenshots to the build console to show the error that happens when trying to build the project...

1- enter image description here

2- enter image description here

3- enter image description here

4- enter image description here

5- enter image description here

when i try to go any further and find the file that they gave me it's path i find this :

enter image description here

the gradle version i'm using is 4.9 ... with this in the project build gradle :

 dependencies {
    classpath 'com.android.tools.build:gradle:3.3.0-alpha08'
    classpath 'com.google.gms:google-services:4.1.0' }

Upvotes: 0

Views: 1420

Answers (1)

5ec20ab0
5ec20ab0

Reputation: 742

Three steps to resolve the problem

  • Use a more stable gradle version as 4.4-all

  • Update Android Support Plugin version to 3.1.4

  • Rebuild Project

gradle-wrapper.properties file content:

    distributionBase=GRADLE_USER_HOME
    distributionPath=wrapper/dists
    zipStoreBase=GRADLE_USER_HOME
    zipStorePath=wrapper/dists
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

Top-level build file: dependencies:

classpath 'com.android.tools.build:gradle:3.1.4'

Finally to show the effect clear gradle cache using File | Invalidate Caches/Restart

after doing that you won't have any problem in the build part

NOTE : if android studio regenerated the files and gave you the same error afterwards you can just disable Aapt2 but that will only work till the end of 2018

you do that by adding android.enableAapt2=false to the gradle.properties file .

Upvotes: 2

Related Questions