2

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.

saltwat5r
  • 1,107
  • 13
  • 21

2 Answers2

0

Have you checked your app bundle to see if it contains the images?

To get to your app bundle, look in the build output directory in the Build/Products/Debug-iphoneos. You will find your app bundle. Context-Menu click on the app bundle and select "Show Package Contents".

If the images are not in the app bundle, then it's a build problem. Check your build settings and see if they are set differently for arm and i386.

If the images are in the app bundle, then it's a load problem. Profile the app for File Activity and see what errors you get when you load images.

Jeffery Thomas
  • 42,202
  • 8
  • 92
  • 117
0

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.

saltwat5r
  • 1,107
  • 13
  • 21