An archive application with Xcode 4.3.1 gives pngcrush to the caught libpng error:

The application works great in the simulator and on the device. But as soon as I try to archive it for submission, I get: When reading / Users / adga / Documents / Adams Lokalt / Appar / NU SÅ / VertragingsApp / Rotation / Customization / Herfst2011 /../../../ default@2x.png pngcrush caught error libpng: PNG unsigned out of range.

I tried opening in Photoshop and replacing (without weaving), but it does not work.

Any ideas?

+4
source share
5 answers

I get this error when I just try to start my project.

This error may occur if you have duplicate file links (I have this problem because I am changing my png images). You can check all your copy files in Bundle Resources and for me there was more than one copy of each "png error file".

You can open Bundle Resources in the following steps: click on the name of your project in the Project Navigator tab, then select your project in Objectives. After that, you should select the Build Phases tab. You will see a list of items: Target Dependencies, Compile Sources, Linking Binary Files to Libraries, and what we are looking for Copy Bundle Resources . Here you can see all of your resources that you add to your project.

To fix this error, you must remove all error files from this list.

After that, you also delete these files in Project Navigator, select all the files that you want to disconnect from the project, and then right-click on them and select delete, then select Remove Reference . All we need is to remove all links from our project.

All that is done, right now, we must add our files back. Right-click the "Project Navigator" button (or in a specific folder / group) and select Add Files to "Your Project Name" and select all the files that you want to delete.

Remember that you delete the link from the files earlier, and they just wait for the project to be added to your folder.

Another reason this error occurs is because the .png file is not a valid .png file, in which case you need to save the file again for the png extension. You can open the image file in preview mode and save it in png. If you have a large number of images, you can use Automator to help you with your task. I hope for this help.

+9
source

I ran into the same problem. I just restarted xCode and recompiled. After that I did not have this problem.

+5
source

I also met this problem. Although the project can still be compiled, it is really annoying.

I redid the png without weaving to another place and replaced the original instead of just saving it in its original place. This worked for me, why would you just try it again?

+4
source

I got this problem when I added two images to a project that already had links to them. When I deleted the duplicate link, the error disappeared.

+3
source

I had the same problem and the error went away after a simple step in Photoshop. Open the existing png file with photoshop and re-save it as "Save for the web and devices" ... that helped!

+1
source

Source: https://habr.com/ru/post/1402692/


All Articles