I have a lot of different flavors for my build that have specific resources and I don\'t want to clutter my src directory in my project with a bunch of flavor-specific direc
From the log It looks like one of your png image might be corrupt, Try replace or remove it and try to build.
\res\drawable-xxxhdpi\background_4.png
After spending a long day on the issue, I have solved it by simply fetching the GIMP and converting the PNG files into JPG, as suggested by someone in google issue tracking.
It worked miracles, and I did not have to change any other file, package version or setting.
I had the same issue. The build would break and mention different png files, like your background_4.png, but only on a Windows PC. The build on a Mac had no problems.
In my case the image size was the problem. Only images bigger than 2MB seamed to break the build. After reducing every image to something lesser than 2MB the build started working again.
i had the same issue while working with android 3.5.3 and the above solution didn't work with me but i found that android studio cant link between the color and vector images my code in vector looked like that
<vector android:height="84dp" android:tint="@color/colorPrimary"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="84dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@color/colorPrimary" android:pathData="M8,5v14l11,-7z"/>
</vector>
when i changed @color/colorPrimary to the color code #F44336 it worked fine
<vector android:height="84dp" android:tint="#F44336"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="84dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#F44336" android:pathData="M8,5v14l11,-7z"/>
</vector>
i hope this helps
Check your layout xml files carefully in my case issue was duplicate xml
<?xml version="1.0" encoding="utf-8"?>
I resolved this problem after reduce the image size.