Image resources (xcassets) not displayed correctly on Yosemite in application built on El Capitan using xcode6.4
Asked Answered
C

4

9

When I build my application on El Capitan using Xcode6.4 (Xcode7 is no option right now), all images/icons (except the AppIcon) does not show, or looks garbled.

Looking at the output from the asset compiler it looks fine, but there are two outputs I suspect could be related, but I am far from certain:

2015-10-02 12:26:53.569 ibtoold[28899:273288] NSFileCoordinator is doing nothing.

2015-10-02 12:26:54.906 ibtoold[28899:276436] CoreUI(DEBUG): CSIGenerator using 'LZFSE' Compression coreui version (362.000000)

Could it be that the LZFSE compression messes up so that Yosemite is unable to decompress correctly, and if so, is there a way to override this?

There is no problem when the application is run on El Capitan.

Any suggestions are very welcome.

UPDATE: These messages are output to console when the app runs on Yosemite:

02.10.15 22.31.59,914 AppName[452]: -[CUIThemeRendition newImageFromCSIDataSlice:ofBitmap: usingColorspace:] Unsupported pixel format in CSI got 36864

02.10.15 22.31.59,914 AppName[452]: Unable to create unsliced image from csi bitmap data.

It seems they had this problem for iOS7 in Xcode beta 3 here

But it seems strange it suddenly appeared again now, and my target is OS X.

UPDATE: So I have upgraded to Xcode7, and the whole problem disappeared. All images and Icons now show correctly in El Capitan and Yosemite.

Cymar answered 2/10, 2015 at 16:25 Comment(2)
I have a similar issue and i am not 100% sure this is this same problem because i am developing with xamarin against ios 8, but it seems to be related. Here is the link to the Xamarin Forum Question, where i posted my follow-up question as isaias-bSnowstorm
I have the same issue but not on El Capitan. I use Yosemite and Xcode 6.4 with Xcode 7 installed.Saturated
T
7

Background Info:

Each version of Xcode comes with a simulator built into it. Xcode 6.4 has iOS Simulator 8.4. Xcode 7.1 has iOS Simulator 9.1 etc. These simulators have profiles stored in Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/CoreSimulator/Profiles/Runtimes

When you install additional simulators, these get shared across Xcode versions, and their profiles are stored at /Library/Developer/CoreSimulator/Profiles/Runtimes

So when you install iOS Simulator 9.0 from Xcode 7.1, the 9.0 simulator profile gets put in the shared location. If you install iOS Simulator 8.4 from Xcode 7.1, it will get put here as well, as Xcode 7.1 is unaware that there is a copy of the iOS Simulator 8.4 hidden inside of Xcode 6.4.

So what appears to be happening is (for Xcode 6.4):

  • when you call actool to create an asset catalogs, it launches ibtoold
  • ibtoold calls through an XPC service (com.apple.coresimulator) and runs an instance of IBCocoaTouchImageCatalogTool on top of the simulator service
  • IBCocoaTouchImageCatalogTool goes through all of the simulator runtimes at /Library/Developer/CoreSimulator/Profiles/Runtimes and apparently uses the latest one it can find. Why it does this is not really clear to me, but no amount of knob fiddling caused it to do anything else.

So if you have Xcode 7.1.1 installed, and download the 9.0 simulator you will break your Xcode 6.4 install because the 9.0 simulator installs its runtime in the shared simulator runtime area, and Xcode 6.4 picks it up and uses it in some cases. This apparently causes actool to mangle any pngs that it is importing. In my experimentation it is fine importing jpgs. Other fun side effects include the fact that attempting to edit Storyboards in Xcode 6.4 causes Xcode 6.4 to crash.

So if you need to have both Xcode 7.x and Xcode 6.4 do NOT install any iOS 9.x simulators from the Xcode 7 installs.

Teevens answered 3/12, 2015 at 18:45 Comment(1)
This could very well be the case for iOS. As I mention quite far down in my question, my app targets OS X, so it seems strange this would have any relations with the iOS-simulator. That being said, you could be on to something regarding the runtimes. I stopped investigating this any further as we upgraded to the latest version of Xcode, and saw the problems disappear.Cymar
S
4

Following (partially) the advice of @drmaclach I followed these steps and got rid of those pesky -[CUIThemeRendition ...] errors (I'm using Xcode 6.4 and Mac OS X 10.11.1)

  • In Xcode, go to Window -> Projects, find your project and press the "Delete" button for "Derived Data"
  • Quit Xcode and iOS Simulator
  • delete iOS 9.0.simruntime from /Library/Developer/CoreSimulator/Profiles/Runtimes
  • Re-open project in Xcode and perform Clean Build Folder under Project when holding down option key
Somersault answered 7/12, 2015 at 0:47 Comment(0)
W
0

Try convert .png to .jpg, my .png does not show too but .jpg is visible. Or don't put them into Images.xcassets.

Workbench answered 7/10, 2015 at 14:56 Comment(0)
A
0

I had the same issue after installing XCode6.4. I sovled it by converting all images into .jpg for .xcassets catalog.

Adrian answered 2/11, 2015 at 11:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.