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 https://7chat.io/app/update
$$ expo build:android --public-url https://7chat.io/app/update/android-index.json

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: com.android.builder.internal.aapt.v2.Aapt2Exception: 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]
[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 https://help.gradle.org
[stderr] BUILD FAILED in 40s

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

I have no idea what’s wrong.

Thanks!

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: https://expo.io/builds/b2951c76-31b8-45b1-9bc9-ec1616234b2e

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)
“icon:”/assets/images/icon_ios.png",
“iconUrl”:“https://7chat.io/app/update/assets/108922d8b7a8a0c953240fafd4c6a2eb”
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.