简体   繁体   中英

Missing Resources on Release mode

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 在此处输入图片说明

Release 在此处输入图片说明

The reason why some images are missing can be in different names of resources for 'Release' ipa file.

I've discovered in my project that info in Asset.car file which is located in ipa archive has the following structure for particular image

"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"

"Name" field started with lowercase letter "bell" while in XCode I had asset named as "Bell". Simply renaming your asset should solve the problem.

So after a crazy search rampage I found a solution. I dont know why it works but I hope you guys can tell me why!

All yiou have to do is go to Build Setting -> Apple LLVM -> Optimization Level -> Release and choose None

Found this on this question

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM