expo build:android fails after adding splash screen

Hello folks,
when I add the expo splash screen I cant build an apk anymore with: expo build:android.

I added the splash screen like this in app.json:

“splash”: {
“image”: “./assets/splash.png”,
“backgroundColor”: “#8BC051”,
“resizeMode”: “cover”
},

This is the error:

Task :app:mergeProdKernelReleaseResources FAILED
17 actionable tasks: 17 executed
[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]
[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 #3
[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 30s
Error: Process exited with non-zero code: 1
at ChildProcess.child.on (/app/node_modules/@expo/spawn-async/build/spawnAsync.js:39:21)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:915:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

I tried different .png files and exported them a couple of times to make sure they are converted correctly. I even changed the path of my assets to the standard path similar to the documentation. I also added the different “xxxhdpi assets” for android in “android”: {}, because I was seeing the warning. That also didn’t help.

expo build:ios works fine.
My sdk Version is 32.

Hope someone can help me.

Greetings,
Chris

If anyone is interested, this solved my issue:

https://github.com/expo/expo-cli/issues/233

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.