Some file crunching failed, see logs for details

泪湿孤枕 提交于 2019-11-27 13:39:10

You can try to add this to your app build.gradle file

 android {
    aaptOptions {  
                cruncherEnabled = false  
            } 
        }

I ran into this problem in the past and did just back the version down. Today when I upgraded to AS 2.0, I got the same problem with the images. I did have to hunt down the offending images (there were 2 in my case) and had my designer re-export them.

Here's how I diagnosed (I'm on a mac FYI):

./gradlew :app:mergeIntegrationDebugResources --debug > buildLog.txt

Once that finished, I opened up the buildLog.txt file, and searched for "Error" (no quotes in actual search). I saw which file was having problems, and then removed it from the appropriate folder, and then re-ran the command above until I didn't get any errors.

I then sent the files that were having problems to my designer and had them re-exported.

Hope this helps!

I've ran into this issue a couple times. The issue I've found is that an asset is either corrupted or has the wrong file extension. In my case it's usually a corrupted image I'd get from the art department. Once I removed the offending file, everything would compile and run just fine.

Basically what's happening is that Android is trying to compress and format the assets and resources, but if one of them is corrupted then it fails.

So try removing any recently added assets or resources.

aaptOptions {
        cruncherEnabled = false
}

Add the above line to your application module build.gradle

Clear the build cache Similar to the Android plugin's clean task that clears your project’s build/ directories, you can run the cleanBuildCache task to clear your project’s build cache. If a project specifies a non-default directory for its build cache, running the task from that project clears only that cache (and not the shared cache in the default location). To execute the task, select View > Tool Windows > Terminal from the menu bar and use one of the following commands:

On Windows:

gradlew cleanBuildCache

On Mac or Linux:

./gradlew cleanBuildCache

in my case it was a png with size 0 in one of the folders.

i had the same issue.

in my case it happends after i added 9-patch file to the project.

Problem: one of the patches arount the image is missing.

Fix: double click on the 9-patch file. make sure you set the patches in all sides (up,down,right,left).

in my case this was the only solution after i tried many things

Please add the below code inside android {} in build.gradle (Module:app)

aaptOptions {  
                cruncherEnabled = false  
            } 

PFA screenshotApp Gradle Build

do not change file extension while pasting into the drawable folder... Some error may occur due to that change (ex: logo.PNG to logo.png )... to avoid this kind of problem you should edit extension before pasting into the drawable.

I use this code.Its working for me perfectly.

android {
aaptOptions {  
            cruncherEnabled = false  
            } 
   }
simple answer works for sure....

just add below code in the build.gradle(Module:app) of your project:

android {
    aaptOptions {
        cruncherEnabled = false
    }
}

example:

Works 100%...@Ambilpur

This problem is caused generally by errors inside the resources files,

Some file crunching failed, see logs for details

most of the times we only see this message all the time, but to have a better diagnostic, delete the folders /build and his contain in your proyect, then the real problemas will show:

Lower down the gradle version in build.graddle file to 1.3.0

 dependencies {
    classpath 'com.android.tools.build:gradle:1.3.0'
 }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!