Home › Build error fixes › Android / Gradle
An image or resource file is invalid
Android / Gradle · last reviewed 2026-11-10
The error looks like this
[stderr] ERROR:/home/expo/workingdir/build/android/app/build/generated/res/react/release/drawable-mdpi/assets_images_library.png: AAPT: error: file failed to compile.
Why it happens
Android could not process the file named in the message — usually a JPEG or WebP saved with a .png extension, or a corrupt image.
How to fix it
- Open the file named in the error and re-export it as a real PNG.
- Check its real type: file path/to/image.png
- File names must be lowercase letters, digits and underscores only.
Not sure this is your error? Let ReleaseMedic read the whole log
Build logs are long and the last line is rarely the real cause. ReleaseMedic finds the first real error, explains it and gives the steps — free, and the log never leaves your computer.
$ npx releasemedic log build.logOr pipe a build straight in: cd android && ./gradlew bundleRelease 2>&1 | npx releasemedic log -
Catch it before you build
Most release errors come from project settings you can check in seconds — signing, SDK levels, privacy manifests, permissions, push and login setup.
$ npx releasemedic