A multiplier of 0 or a nil second item together with a location for the first attribute cr...

A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal constraint of a location equal to a constant. Location attributes must be specified in pairs.

iOS 15 上最近的Crash

以上就是我们最近 Bugly 上的一个 Crash, 仅仅发生在 iOS 15 上,之前都是好的

一、初步分析

  • 布局之前,该视图没有添加到父视图上
  • 布局的时候,约束的写法不对,没有对应之类的

二、代码分析

代码定位

三、备用应急方案

由于此处是一个简单的视图,可以直接替换,直接不用这个方法啦。

四、慢慢着手分析

今天再次分析的时候,发现 [UIApplication sharedApplication].keyWindown 可能是为空的,如果这个为空的情况,那就很符合目前这个错了
解决方法:[UIApplication sharedApplication].delegate.window 用其代替的。

目前通过上面这个方法发布几个版本发现暂时没重现。。。。。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容