报错信息如下
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. 2024-09-24 08:56:23.994455+0800 smartmotoios[52875:7310191] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE. 2024-09-24 08:56:23.994521+0800 smartmotoios[52875:7310191] dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. N10__cxxabiv116__shim_type_infoE, id, N10__cxxabiv117__pbase_type_infoE. 2024-09-24 08:56:23.994611+0800 smartmotoios[52875:7310191] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSLayoutConstraint for <UIView: 0x13f63fcb0; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x283340c00>; layer = <CAGradientLayer: 0x283dba620>>: 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.' *** First throw call stack: (0x1e374d288 0x1fc47c744 0x1fc77f1b0 0x1fc77e534 0x10bd0e6a8 0x10bd0e2c0 0x10bd0d260 0x10bd157bc 0x10bd154c4 0x10bd1a33c 0x10bd1a5e8 0x10bd1aa2c 0x10bd21708 0x104adf9f8 0x104a8fdc4 0x104a8e99c 0x104a907b4 0x1e5db89c4 0x1e5fb6030 0x1e5dddbbc 0x1e5caded8 0x1e5cbe17c 0x1e74367fc 0x1e7428c60 0x1e743d5b4 0x1e74464a8 0x1e5c97b2c 0x1e36f50c4 0x1e36c4080 0x1e36bf13c 0x1e36d2bc8 0x1ff83d374 0x1e6046b58 0x1e5dc8090 0x1075a2308 0x10a6f9da4) 2024-09-24 08:56:24.112431+0800 smartmotoios[52875:7310191] [Bugly] Trapped uncaught exception 'NSInvalidArgumentException', reason: 'NSLayoutConstraint for <UIView: 0x13f63fcb0; frame = (0 0; 0 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x283340c00>; layer = <CAGradientLayer: 0x283dba620>>: A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal
解决方法:
在 Xcode 中设置符号断点(symbolic breakpoint),方法是在 Breakpoint Navigator 中添加一个新的符号断点,输入 UIViewAlertForUnsatisfiableConstraints
。这将帮助你定位问题出现的位置。
标签:__,24,xcode,56,0800,约束,报错,type,08 From: https://www.cnblogs.com/qingzZ/p/18428378