I'm trying to run an iOS7 project under Xcode6 on an iOS7 device. At first all seemed to be A-OK, but then I noticed that all images that reside in Images.xcassets don't show up at runtime.
I can see then correctly in design (storyboard), and I see them if I run the app in the simulator.
Anyone having an idea how to fix this? Thanks!
NOTE: the project runs fine on Xcode5.x therefore it's not the usual culprit (mismatch in the image name "casing").
ADDITIONAL NOTE: I've just tried with another iOS7 project: same problem...
ADDITIONAL NOTE: I've tried using image assets in a brand new project created under Xcode and... images show up.
Something I found in the Xcode 6 Beta Release Notes:
Images from asset catalogs in projects with a minimum deployment
target of iOS 7 or OS X 10.9 will be available when running on iOS 8
and OS X 10.10, but not iOS 7 and OS X 10.9.(17029658)
I had the same problem, I have noticed that if I move my images from Images.xcassets to the "Supporting Files" folder, the images show up on iOS7. I Hope this helps
I suddenly add jpg image to Image Assets. When resaved in png, all work OK
Great find @o KB o! I've also found it surprisingly hard to get rid of asset bundles in my project when switching away from asset bundles and including images directly in my project.
Here's my full workaround:
- Copy each image out of your
.xcassets
image bundle to a new directory (let's call it Images/
). See below for a script to make this easier.
- Delete your
.xcassets
bundle. (surprisingly, removing it from the project isn't enough. In my testing, if the .xcassets
bundle was anywhere in the same directory as the Xcode project or related sources, it would get copied in. Alternately, you can remove the .xcassets
extension)
- Add all your image files in
Images/
to your Xcode project
- Clean (cmd + shift + k)
- Delete the app from the target device or simulator
- Install and run
To make step #1 less tedious, I wrote a script to copy images out of the .xcassets
bundle and into a directory of your choice: https://github.com/johnboiles/xcasset_exporter
mkdir Images
./xcasset_exporter.py MyProject/Images.xcassets Images
I've just read about Xcode 6 beta 2: the problem will be fixed.
Downloading it as I'm writing :)