Error:Execution failed for task ':ProjectName:mergeDebugResources'. > Crunching Cruncher *some file* failed, see logs

后端 未结 22 2360
Happy的楠姐
Happy的楠姐 2020-11-29 07:49

I have this error when trying to make a module of a project

apply plugin: \'com.android.library\'

android {
    compileSdkVersion 17
    buildToolsVersion \         


        
相关标签:
22条回答
  • 2020-11-29 08:19

    I came here because i had this problem and non of the answers here helped me. For future user that could be helped here:

    My problem was I did two 9-patch images for a switch button. Then I rezized that image without 9-patching them. To solve the issue I had to 9-patch all the images for all the drawable folders (xxhdpi, xhdpi and so on)

    0 讨论(0)
  • 2020-11-29 08:19

    This could also some extra reasons instead of the mentioned reasons :

    • You have a crashed image : one of your images cannot be load
    • adding an image to the drawable folder and modifying it's type (png ,jpg) while giving it a name(or inside the drawable folder using the rename function)
    0 讨论(0)
  • 2020-11-29 08:22

    Ok, I just faced this problem and tried all of the steps mentioned above but didn't help. So what I did, I checked what image extension it was before I renamed it to .png. In my case it was .jpeg. So I renamed it back to .jpeg and kept the same original file in drawable. And bingo, it just worked fine.

    So the solution is, use the file without changing extension, be it .png or .jpeg, keep it the original way.

    Thought to share if it helps anyone. Thanks.

    0 讨论(0)
  • 2020-11-29 08:22

    I had faced this similar error too. In my case it was one of my picture files in my drawable folder. Removing the picture that was unused solved the problem for me. So, make sure to remove any unused items from drawable folder.

    0 讨论(0)
  • 2020-11-29 08:22

    I have tried methods mentioned above, restarting the AS didn't work for me, and rebuilding didn't work either. Finally I found the problem was with the .9.png files, I deleted them and rebuilt the project, and it worked fine! Try it.

    0 讨论(0)
  • 2020-11-29 08:23

    Close android studio and open it again. Then try compiling the same code. I was getting the same error and it worked for me. Hope it helps.

    0 讨论(0)
提交回复
热议问题