From time to time, you may get a mysterious error in Xcode:
pngcrush caught libpng error:
Something like the image below:
The explanation Compress PNG Files Error will just confuse you. Xcode 9 will compile the code and run the app in spite of marking it red. It will even archive the app just before sending it to the App Store and it will still be passed through.
Further explanation will say image.png pngcrush caught libpng error. and also: copying emitted errors but did not return a nonzero exit code to indicate failure. The image seems to be OK but something is wrong anyhow… what could that be!? Turns out that your project will have the same image name listed twice in the Build Phases screen. Eliminate the redundant files from the list and make it look like this:
The app will run without any red flags whatsoever.