Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 911
Trond Avatar asked Oct 02 '15 16:10

Trond


1 Answers

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.

like image 77
dmaclach Avatar answered Dec 01 '22 21:12

dmaclach