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

*爱你&永不变心* 提交于 2019-12-01 03:46:30

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.

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

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

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!