TestFlight 构建崩溃,但 Xcode 构建工作正常

TestFlight Build Crashes, but Xcode Build Works Fine

我正在使用 Apple 的 TestFlight 测试版测试服务来测试我的应用程序。我的 Xcode 版本在我的 iPhone 6 和其他旧设备上运行良好。

当我将我的构建上传到 iTunes Connect 并开启 Beta 测试时,一切最初都运行良好。用户可以启动应用程序并执行大多数操作而不会导致应用程序崩溃。但是,当用户单击 "Play Game" 按钮时,应用程序莫名其妙地崩溃了!

因为可以毫无问题地打开该应用程序,所以我假设它与配置文件无关。在完全相同的设备上,Xcode 构建工作正常,但 TestFlight 版本在按 "Play Game" 时崩溃。

我还假设这 不是 内存问题,因为当 运行 设备上的应用程序显示它时 Xcode 中显示的内存单击玩游戏时小于 10 mb。

在调试控制台中遇到一些 AutoLayout 问题,这可能是问题所在吗?

2015-02-09 17:35:15.611 CYM SA[13111:2396370] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
"<NSLayoutConstraint:0x1700919e0 H:|-(0)-[UIButton:0x14fe24470'Go To: 1']   (Names: '|':UIView:0x170193180 )>",
"<NSLayoutConstraint:0x170091a30 H:[UITextView:0x150856a00'hello, I'm 0 wow A paragr...']-(8)-|   (Names: '|':UIView:0x170193180 )>",
"<NSLayoutConstraint:0x170091ad0 H:|-(8)-[UITextView:0x150856a00'hello, I'm 0 wow A paragr...']   (Names: '|':UIView:0x170193180 )>",
"<NSLayoutConstraint:0x170091b70 H:[UIButton:0x14fe24650'Go To: 2']-(0)-|   (Names: '|':UIView:0x170193180 )>",
"<NSLayoutConstraint:0x170091c10 UIButton:0x14fe24650'Go To: 2'.width == UIButton:0x14fe24470'Go To: 1'.width>",
"<NSLayoutConstraint:0x170091c60 H:[UIButton:0x14fe24470'Go To: 1']-(0)-[UIButton:0x14fe24650'Go To: 2']>",
"<NSAutoresizingMaskLayoutConstraint:0x1700938d0 h=--& v=--& UIButton:0x14fe24470'Go To: 1'.midX == - 1850>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x170091c60 H:[UIButton:0x14fe24470'Go To: 1']-(0)-[UIButton:0x14fe24650'Go To: 2']>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.

@AdamPro13 添加 Crashlytics 让我找到了问题所在。无论出于何种原因 ONEONE for 循环中初始化的变量导致了所有这些骚动。仍然很奇怪,这并没有使从 Xcode 加载到我的设备的构建崩溃。当我尝试从数组中获取自定义对象时出现问题,但异常中显示的数字很大,例如 1844402943409882943843209824390 或接近于此的数字。

这个:

 for (int i; i<[self.elementsArray count]; i++) {
    Element *tempElement = [[Element alloc] init];
    tempElement = [self.elementsArray objectAtIndex:i];
}

应该是这样的:

for (int i = 0; i<[self.elementsArray count]; i++) {
    Element *tempElement = [[Element alloc] init];
    tempElement = [self.elementsArray objectAtIndex:i];
}