Android build error , but no cli errors

so I simply ran the command “expo build:android” inside a project which had no errors , but i am getting build errors , here are the logs

[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:mergeReleaseResources'.
[stderr] > Multiple task action failures occurred:
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]       > Android resource compilation failed
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr]             
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]       > Android resource compilation failed
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/drawable-xxhdpi/shell_notification_icon.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr]             
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/drawable-xxhdpi/shell_notification_icon.png: AAPT: error: file failed to compile.
[stderr]             
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: file failed to compile.
[stderr]             
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]       > Android resource compilation failed
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/mipmap-mdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr]             
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/mipmap-mdpi/ic_launcher.png: AAPT: error: file failed to compile.
[stderr]             
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]       > Android resource compilation failed
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/drawable-xhdpi/shell_notification_icon.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr]             
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/drawable-xhdpi/shell_notification_icon.png: AAPT: error: file failed to compile.
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]       > Android resource compilation failed
[stderr]             
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/mipmap-xxxhdpi-v26/ic_foreground.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr]             
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/mipmap-xxxhdpi-v26/ic_foreground.png: AAPT: error: file failed to compile.
[stderr]             
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]       > Android resource compilation failed
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/drawable-hdpi/shell_notification_icon.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr]             
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/drawable-hdpi/shell_notification_icon.png: AAPT: error: file failed to compile.
[stderr]             
[stderr]    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr]       > Android resource compilation failed
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/drawable-mdpi/shell_notification_icon.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr]             
[stderr]         /app/turtle/workingdir/android/sdk41/android-shell-app/app/src/main/res/drawable-mdpi/shell_notification_icon.png: AAPT: error: file failed to compile.
[stderr]             
[stderr] * Try:
[stderr] Run with --stacktrace option to get the stack trace. Run with --info or 
[stderr] --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 28s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
10 actionable tasks: 10 executed
Error: ./gradlew exited with non-zero code: 1
    at ChildProcess.completionListener (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:52:23)
    at Object.onceWrapper (events.js:418:26)
    at ChildProcess.emit (events.js:311:20)
    at ChildProcess.EventEmitter.emit (domain.js:482:12)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    ...
    at spawnAsync (/app/turtle/node_modules/@expo/xdl/node_modules/@expo/spawn-async/build/spawnAsync.js:17:21)
    at spawnAsyncThrowError (/app/turtle/node_modules/@expo/xdl/build/detach/ExponentTools.js:201:45)
    at buildShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:976:11)
    at async Object.createAndroidShellAppAsync (/app/turtle/node_modules/@expo/xdl/build/detach/AndroidShellApp.js:396:5)
    at async runShellAppBuilder (/app/turtle/build/builders/android.js:95:9)
    at async Object.buildAndroid [as android] (/app/turtle/build/builders/android.js:43:28)
    at async build (/app/turtle/build/jobManager.js:181:33)
    at async processJob (/app/turtle/build/jobManager.js:118:32)
    at async Object.doJob (/app/turtle/build/jobManager.js:49:5)
    at async main (/app/turtle/build/server.js:66:13)

here are the logs from “expo diagnostics”

  Expo CLI 4.4.8 environment info:
    System:
      OS: Windows 10 10.0.19041
    Binaries:
      Node: 14.15.3 - C:\code\nodejs\node.EXE
      npm: 6.14.9 - C:\code\nodejs\npm.CMD
    npmPackages:
      expo: ~41.0.1 => 41.0.1
      react: 16.13.1 => 16.13.1
      react-dom: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2
      react-native-web: ~0.13.12 => 0.13.18
    Expo Workflow: managed

failed to read PNG signature: file does not start with PNG signature

your icons are malformed or in incorrect format

1 Like

Thanks man ! The error is gone . I sure am super dumb

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