Android - Error:Execution failed for task ':app:mergeDebugResources'

后端 未结 12 840
孤独总比滥情好
孤独总比滥情好 2020-12-13 14:31

please help me!

here is error says:

Error:Execution failed for task \':app:mergeDebu

相关标签:
12条回答
  • 2020-12-13 14:49

    Try code on your module build.gradle:

    android {
    // ...
    aaptOptions.cruncherEnabled = false
    aaptOptions.useNewCruncher = false
    // ...
    }
    

    It means Android studio DO NOT check PNG strictly.

    0 讨论(0)
  • 2020-12-13 14:49

    Try to check that, if you use a 9-patch image, it is in correct format (with black pixel on the edge and they mustn't touch the pixel of your image). I resolved this problem with changing a 9-patch image that is malformed. In my case the image touched the black pixel of 9-patch e android studio showed that error.

    0 讨论(0)
  • 2020-12-13 14:53

    In my case I had one 9-patch resource in every screen density drawable folder. Black borders in every resource didn't match eachother so I stretched them up to the very corner, so they all matched.

    This is the result:

    And then it worked!

    0 讨论(0)
  • 2020-12-13 14:59

    I got the same issue after I added 9 patch image in my project. Removing that image solved my problem.

    0 讨论(0)
  • 2020-12-13 14:59

    Some times I also get this error

    Rebuilding the entire project before running (Build > Rebuild Project) it doesn't show up anymore.

    You can try this.

    0 讨论(0)
  • 2020-12-13 15:02

    I got the same issue when I insert png image to drawable folder. I delete that image,clean project and rebuild it , the issue resolved.This worked for me.

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