Build app with Xcode 4 - it always show some error about PNG image

前端 未结 22 941
走了就别回头了
走了就别回头了 2020-12-07 12:46

When I build my app with Xcode 4 it always show this error message:

CopyPNGFile /Users/michaelchen/Library/Developer/Xcode/DerivedData/iMusicBox-boeawugacmha         


        
相关标签:
22条回答
  • 2020-12-07 13:00

    Eva Madrazo posted the right answer (at least for problems with interlaced PNGs), but for those having this problem with a bunch of images as I did, you can use mogrify recursively to de-Interlace every file at once.

    find ./ -name "*.png" -exec mogrify -interlace none {} \;
    

    Changing the interlace method doesn't appear to affect the image quality, but affects the image size, none will give you a smaller image.

    Mogrify comes with ImageMagick and you can install it with homebrew.

    0 讨论(0)
  • 2020-12-07 13:01

    It looks like your PNG file list_cell.png is corrupt. Xcode 4 makes more checks than Xcode 3 in many areas and reveals problems that have been lurking in your project all the time.

    Have you tried to open your PNG file in an image editor and save it again?

    0 讨论(0)
  • 2020-12-07 13:01

    This error happens because you have an image in resources that's smaller than 5 pixels in width or height and you are trying to resize that image. Set all images to minimum of 5 pixels and error disappears.

    0 讨论(0)
  • 2020-12-07 13:02

    That happens when you have multiple entries for the image file in your project file. I have no idea why but I just removed all entries, reloaded the project and added the file again.

    0 讨论(0)
  • 2020-12-07 13:04

    In my case I solved the problem by removing the blank "space-key" in folder/filename.

    Hope this works for somebody too.

    0 讨论(0)
  • 2020-12-07 13:04

    in my case with xcode 4.5 the problem is solved by permission giving with terminal

    chmod -R +rw /yourprojectpath/yourprojectfolder

    this is maybe not the best solution because of locking files with file sharing. But will do if you are in hurry.

    0 讨论(0)
提交回复
热议问题