Software Archive
Read-only legacy content
17061 Discussions

build failure: "libpng error: Not a PNG file"

PaulF_IntelCorp
Employee
890 Views

If you are experiencing build failures with CLI 5 Android builds, and the detailed error log includes a message similar to the following:

* What went wrong:
Execution failed for task ':mergeArmv7ReleaseResources'.
> Error: Failed to run command:
  	/Developer/android-sdk-linux/build-tools/22.0.1/aapt s -i .../platforms/android/res/drawable-land-hdpi/screen.png -o .../platforms/android/build/intermediates/res/armv7/release/drawable-land-hdpi-v4/screen.png
  Error Code:
  	42
  Output:
  	libpng error: Not a PNG file

You need to change the format of your icon and/or splash screen images to PNG format.

The error message refers to a file named "screen.png" -- which is what each of your splash screens were renamed to before they were moved into the build project resource directories. Unfortunately, JPG images were supplied for use as splash screen images, not PNG images. So the files were renamed and found by the build system to be invalid.

Convert your splash screen images to PNG format. Renaming JPG images to PNG will not work! You must convert your JPG images into PNG format images using an appropriate image editing tool. The Intel XDK does not provide any such conversion tool.

Beginning with Cordova CLI 5, all icons and splash screen images must be supplied in PNG format. This applies to all supported platforms. This is an undocumented "new feature" of the Cordova CLI 5 build system that was implemented by the Apache Cordova project.

0 Kudos
0 Replies
Reply