Build error with --public-url option

When I try to build android, error happened. command is like =>
$$ expo build:android
everything looks fine.

but but building android failed, command is like =>
$$ expo export --public-url
$$ expo build:android --public-url

errors =>

Task :app:generateProdKernelReleaseResources
Task :app:mergeProdKernelReleaseResources FAILED
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ‘:app:mergeProdKernelReleaseResources’.
[stderr] > java.util.concurrent.ExecutionException: Android resource compilation failed
[stderr] Output: /app/workingdir/android/sdk32/android-shell-app/app/src/main/res/mipmap-xhdpi/ic_launcher.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/86f0959622145d3be808625a1d88d51d/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/mipmap-xhdpi/ic_launcher.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
[stderr] BUILD FAILED in 40s

build id : bd00014e-c6f8-4364-9cb2-50db5188b8f2

I have no idea what’s wrong.


Hi @badani! Could you try the solutions suggested in this Github issue and see if that works?

Let me know!

It looks like the same problem, but I don’t think so. This is because an error occurs only when you build using the ‘–public-url’ option.

$$ expo build:android
this command works fine. you can check it:

I found that the icon image was the cause of the problem in your reply and solved the problem. Very very thanks.
If the ‘–public-url’ option was used, the link referring to the icon image was as follows (android-index.json)
Error was probably occurred because the MIME type was not set and in my asset server, the icon image could not be downloaded while compiling.
The MIME type is set, so the build works well.

Thank you for your help!

1 Like

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