APP启动异常崩溃--pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug

一、问题场景

APP启动异常崩溃

BlockChainStep(1332,0x7000057ad000) malloc: * error for object 0x600000008300: pointer being freed was not allocated
* set a breakpoint in malloc_error_break to debug

二、崩溃原因

在Xcode8中,如果你的图片资源文件里有16位图或者图片显示模式为P3,并且Deployment Target是iOS9.3以下的就会出现这个问题。(话说我公司的项目里面就出现了一个小按钮,导致了这次崩溃,不知道设计师是怎么弄出来的这个特殊图片…)如果你的App需要支持wide color functionality,那你就必须设置Deployment Target为iOS9.3以上。如果你的APP不需要支持wide color functionality并且你希望兼容iOS老版本,那么你需要将所有16-bit or P3 assets的图片转换为8-bit sRGB assets

三、解决方案

转换图片为8-bit sRGB assets格式

参考文章:Xcode的assets问题导致运行iOS8崩溃的解决方案

猜你喜欢

转载自blog.csdn.net/Hanrovey/article/details/82110119