Building android app error when changing icon

I’ve no idea what the problem is and I’ve googled extensively without finding anything useful. I made an app, which is a simple WebView wrapper for a vuejs app, and it works perfectly, I can compile it with no problems at all, downloaded the APK, installed it on my phone, everything good.

However, when I try to change the icon (assets/icon.png) to another one, it gives me a compilation error. I’ve not touched anything else, did a pretty default vue native project with the cli. Modified the icon using gimp in order to retain all the properties of the original one, checked everything to make sure it’s a png identical to the other one, but nothing. I’m programming using AWS Cloud9, if it’s of any importance. All the configuration files are unmodified.

▼starting builder

Starting build process

▼icons setup

ImageUtils: setting image functions to alternative sharp implementations

▼reading manifest

Using manifest: {"android":{"package":"com.vue.time"},"bundledAssets":[],"description":"Ve tus reportes VESSI","icon":"./assets/icon.png","iconUrl":"https://d1wp6m56sqw74a.cloudfront.net/~assets/3307da80c68bc8518643beaee99705fe","ios":{"supportsTablet":true},"locales":{},"name":"Reportes VESSI","orientation":"portrait","packagerOpts":{"config":"rn-cli.config.js"},"platforms":["ios","android"],"privacy":"public","sdkVersion":"32.0.0","slug":"App","splash":{"backgroundColor":"#ffffff","image":"./assets/splash.png","imageUrl":"https://d1wp6m56sqw74a.cloudfront.net/~assets/43ec0dcbe5a156bf9e650bb8c15e7af6","resizeMode":"contain"},"updates":{"fallbackToCacheTimeout":0},"version":"1.0.0","id":"@albertosara/App","revisionId":"1.0.0-r.4l3xOzz25w","publishedTime":"2019-02-03T17:34:27.071Z","commitTime":"2019-02-03T17:34:27.103Z","bundleUrl":"https://d1wp6m56sqw74a.cloudfront.net/%40albertosara%2FApp%2F1.0.0%2Fd9cdf3842a6f00099fdff7fa4453eb3d-32.0.0-android.js","releaseChannel":"default","hostUri":"expo.io/@albertosara/App"}

▼confirming that dynamic macros exist

/app/workingdir/android/sdk32/tools-public /app/workingdir/android/sdk32/android/app
/app/workingdir/android/sdk32/android/app
Unhandled promise rejection: Error: Failed to resize image: ic_launcher.png. Error: Input file is missing or of an unsupported image format
    at /app/node_modules/xdl/build/detach/AndroidIcons.js:62:19
    at Generator.throw (<anonymous>)
    at step (/app/node_modules/xdl/build/detach/AndroidIcons.js:232:191)
    at /app/node_modules/xdl/build/detach/AndroidIcons.js:232:402
    at <anonymous>

▼running gradle

Parallel execution with configuration on demand is an incubating feature.
> Configure project :app
AWS Device Farm Plugin version 1.3
AWS Device Farm configuration is NOT VALID
AWS Device Farm configuration is NOT VALID
Could not find google-services.json while looking in [src/dev/kernel/debug, src/devKernel/debug, src/debug/devKernel, src/dev/debug, src/dev/kernel, src/dev/kernelDebug, src/devKernel, src/debug, src/devKernelDebug, src/dev, src/devDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/dev/kernel/release, src/devKernel/release, src/release/devKernel, src/dev/release, src/dev/kernel, src/dev/kernelRelease, src/devKernel, src/release, src/devKernelRelease, src/dev, src/devRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/prod/kernel/debug, src/prodKernel/debug, src/debug/prodKernel, src/prod/debug, src/prod/kernel, src/prod/kernelDebug, src/prodKernel, src/debug, src/prodKernelDebug, src/prod, src/prodDebug]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Could not find google-services.json while looking in [src/prod/kernel/release, src/prodKernel/release, src/release/prodKernel, src/prod/release, src/prod/kernel, src/prod/kernelRelease, src/prodKernel, src/release, src/prodKernelRelease, src/prod, src/prodRelease]
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
> Task :app:checkProdKernelReleaseClasspath
> Task :app:preBuild UP-TO-DATE
> Task :app:extractProguardFiles
> Task :app:preProdKernelReleaseBuild
> Task :app:compileProdKernelReleaseAidl NO-SOURCE
> Task :app:compileProdKernelReleaseRenderscript
> Task :app:checkProdKernelReleaseManifest
> Task :app:generateProdKernelReleaseBuildConfig
> Task :app:prepareLintJar
> Task :app:mainApkListPersistenceProdKernelRelease
> Task :app:mergeProdKernelReleaseShaders
> Task :app:compileProdKernelReleaseShaders
> Task :app:generateProdKernelReleaseAssets
> Task :app:mergeProdKernelReleaseAssets
> Task :app:processProdKernelReleaseGoogleServices
Parsing json file: /app/workingdir/android/sdk32/android-shell-app/app/google-services.json
> Task :app:createProdKernelReleaseCompatibleScreenManifests
> Task :app:processProdKernelReleaseManifest
> Task :app:fabricGenerateResourcesProdKernelRelease
> Task :app:generateProdKernelReleaseResValues
> 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/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/mipmap-xhdpi/ic_launcher.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 32s
17 actionable tasks: 17 executed
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)

Thanks in advance!

Hi @albertosara - it looks like the new icon.png you’ve exported is not a valid PNG file. I’d recommend trying to export it again, perhaps with different settings or from a different image editor.

Thanks for the suggestion, it was one of the first things I tried, I even attempted to draw over the same default icon using gimp to make sure I didn’t change any setting, but nothing.

In the end I opted to download android studios’ sdk and build tools and compile them locally, and funnily enough all the icons I tried previously ended up working, so I really have no idea what the fault was. I uploaded the icon to Cloud9 using different methods to make sure there wouldn’t be any sort of compression being done and things of the like.

Thanks for your reply, though! Hopefuly this issue gets looked into because expo is a very useful tool.

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