expo build:android error

#1

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] >
[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]
[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] -o
[stderr] /app/workingdir/android/sdk32/android-shell-app/app/build/intermediates/res/merged/prodKernel/release
[stderr] /app/workingdir/android/sdk32/android-shell-app/app/src/main/res/drawable-xxxhdpi/shell_launch_background_image.png
[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.

This is a sample failed build: https://expo.io/builds/0c20dc5d-a777-4265-aa30-f3aa4f07bf11

#2

Hello Matt,
I had the same error, maybe this will help.

Had something to do with using the wrong version of react-native, so new assets were not uploaded.

Greetings

#3

Thank you! But I had to use RN 0.57.8 in order to use some other packages that were quite essential to our app, Maybe I will find a way around it if nothing can be done, haha.

#4

Bump :slight_smile:

Just wondering if the Expo developers have noticed this issue, and if so, will there be any sort of resolutions? I would love to be able to use my custom splash image.

#5

the file that you are providing is not a png as the error message suggests. make sure you use an actual png image and not a file renamed to have a png extension :wink:

#6

Hi! The first post in this thread explained that I have made SURE that the image is indeed a png, I checked with both photoshop and GIMP. But thank you for your help still~

#7

can you share the image somewhere?

#8

Of course, can I maybe send it to you directly over the expo Slack channel?

#9

it would be ideal if you could upload somewhere and share here, or create a github issue and put it there. this would allow for all of the context around your issue to be in one place

#10

Sorry for the late reply, here is an image that could reproduce our problem, thanks a bunch!