For some strange reason, my standalone android build will fail if I use any image other that the default one as the splash image.
And I would get the error below:
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ‘:app:mergeProdKernelReleaseResources’.
[stderr] java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
[stderr] Output: /app/workingdir/android/sdk32/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] Command: /root/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/84b76afa7d0c48bd9c8191ef4eb60805/aapt2-3.2.1-4818971-linux/aapt2 compile --legacy
[stderr] Daemon: AAPT2 aapt2-3.2.1-4818971-linux Daemon #5
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 27s
17 actionable tasks: 17 executed
I have made sure that my image is indeed a PNG. So it definitely is NOT some jpg saved as PNG. Everything works just fine on Expo Client, and I have spent more than 3 hours trying to fix this, but no luck whatsoever.
I think the problem with me is that I am using React Native 0.57.8 with Expo 32, this is not the officially supported combination but I needed it for something. Was there any insight looking into the specific build log that I provided?