Search code examples
iosxcodecocoa-touchuiimagexcasset

Images.xcassets stopped working after Xcode project Clean Build Folder - iOS


I have a problem with Images.xcassets, where I'm using *.jpg images. Earlier it was working well, but after doing "Clean Build Folder" it stopped working on device, but still working on simulator. Now images not showing in app. Does anyone know why? I would add that I removed app from device and builded and compiled project once again - the same effect.


Solution

  • Problem solved. Finally I found that if you added *.jpg files into Images.xcassets, Xcode always create *.png files from *.jpg. In "Build Settings" of project is option for "Compress PNG Files" which by default is setted to YES, and then Xcode probably trying to compress to *.png while it receive *.jpg files, as a result does not copy images to bundle. When you switch "Compress PNG Files" to "NO" *.jpg files are only converted (not compressed) to *.png and takes up as much space as *.jpg, and finally are successfully copied to app's bundle.