Expo + React Native: APT cant compile images
Hi (and goodbye) folks. This is going to be a flash article. My main goal is to keep sharing a few (a lot) of issues that may happen to you during your react-native application development (with expo). Kindly hit the like button and subscribe for more quick fix issues 🙌
AAPT: error: file failed to compile with PNG images
Long story short, if you ever faced this kind of issue while building a release for android applications, make sure that the extension of the file is what is meant to be. Even though you may just change the extension, just don’t. Android gradle asset packaging throws this kind of issue while compiling the app resources.
From android developer: AAPT2 (Android Asset Packaging Tool) is a build tool that Android Studio and Android Gradle Plugin use to compile and package your app’s resources. AAPT2 parses, indexes, and compiles the resources into a binary format that is optimized for the Android platform.
To fix this issue convert this image to png properly. You will be amazed afterwards. The problem will just get fixed. Stay tuned for more.