Missing Resources on Release mode

时间:2016-02-12 21:00:25

标签: ios objective-c xcode swift

I'm using this Library which works perfectly when running with debug mode on simulator or device. Although when running it on release mode some - not all - images are missing.

The weird thing is that all images of the library are in a .xcassets which is also in my copy bundle resources phase. Still, few are displayed others are not. Following are two images of the screen in debug/release mode.

Any help or hints would be awesome!!

Debug enter image description here

Release enter image description here

2 个答案:

答案 0 :(得分:1)

缺少某些图像的原因可能是“发布” ipa文件的资源名称不同。

我在项目中发现,位于ipa档案中的Asset.car文件中的信息具有特定图像的以下结构

"AssetType" : "Image",
"BitsPerComponent" : 8,
"ColorModel" : "Monochrome",
"Colorspace" : "gray gamma 22",
"DeploymentTarget" : "2018",
"Idiom" : "universal",
"Image Type" : "kCoreThemeOnePartScale",
"Name" : "bell",
"Opaque" : false,
"PixelHeight" : 25,
"PixelWidth" : 24,
"RenditionName" : "bell.png",
"Scale" : 1,
"SizeOnDisk" : 334,
"Template Mode" : "automatic"

“名称”字段以小写字母“ bell”开头,而在XCode中,我将资产命名为“ Bell”。只需重命名资产即可解决问题。

答案 1 :(得分:0)

因此,在疯狂搜索横冲直撞后,我找到了解决方案。我不知道为什么会这样,但我希望你们能告诉我为什么!

所有你需要做的就是去Build Setting - > Apple LLVM - > Optimization Level - > Release并选择None

在此question

上找到此信息