I have this error when trying to make a module of a project
apply plugin: \'com.android.library\'
android {
compileSdkVersion 17
buildToolsVersion \
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)
This could also some extra reasons instead of the mentioned reasons :
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.
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.
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.
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.