ios - 应用程序在 Apple Review 中崩溃,但在本地开发中没有
问题描述
该应用程序在 Apple 团队审查时崩溃,但在开发时无法重现崩溃。
我尝试在所有可能的模拟器中运行它,还尝试了 Amazon AWS Device Farm 和 2 种不同的真实设备(iPad 和 iPhone)。
DateFormater 似乎无法解析日期并返回 nil,在此之前我们已经解析了一些其他字段,但没有日期。
我们认为格式应该是指定的(我们可以在我们的设备上解析它)并且我们使用与苹果审查团队相同的帐户。
我们还尝试将日历切换为非公历,这也没有使应用程序崩溃。
该应用程序self.modified = ...
在行上崩溃
从 Event.swift ...
import SwiftyJSON
...
required init(json: JSON) {
self.id = json["tm_event_id"].int!;
self.name = json["name"].string!;
self.eventStatus = EventStatus.init(rawValue: json["event_status"].string!)!;
self.modified = AppDelegate.formaterDatetime.date(from: json["modified"].string!)!;
self.dateFrom = AppDelegate.formaterDate.date(from: json["date_from"].string!)!;
...
}
从 AppDelegate.swift ...
static var formaterDatetime:DateFormatter {
let f = DateFormatter();
f.dateFormat = "yyyy-MM-dd HH:mm:ss";
f.timeZone = dataTimeZone
f.locale = Calendar.current.locale;
return f;
}
后端响应(基于我们的服务器日志)
[
{
"tm_event_id": 1082,
"company_id": 16,
"organization_id": 58,
"org_user_id": 126,
"org_location_id": 93,
"name": "My Test",
"date_from": "2019-03-25",
"date_to": "2019-03-30",
"week_ending": "2019-03-31",
"placement_count": 6,
"notes": "",
"event_status": "private",
"created": "2019-03-04 13:25:25",
"modified": "2019-03-04 13:25:25",
"subrequirements": [ ... ],
"timesheets": [ ... ]
}
崩溃日志
Crashed: com.apple.root.user-initiated-qos
0 YouRecruit Work Tracker 0x1028b9470 specialized Event.init(json:) (Event.swift:224)
1 YouRecruit Work Tracker 0x10286424c specialized static StorableItem.initStatic(json:) (Event.swift)
2 YouRecruit Work Tracker 0x102844b20 closure #3 in _TempManAPI.().init() (<compiler-generated>)
3 YouRecruit Work Tracker 0x102844c4c specialized thunk for @escaping @callee_guaranteed (@guaranteed Entity<JSON>) -> (@owned [Event]?, @error @owned Error) (<compiler-generated>)
4 Siesta 0x102e22a0c (Missing)
5 Siesta 0x102e2250c (Missing)
6 Siesta 0x102df4700 (Missing)
7 Siesta 0x102df9c70 (Missing)
8 Siesta 0x102df96fc (Missing)
9 Siesta 0x102df163c (Missing)
10 Siesta 0x102de9fbc (Missing)
11 libdispatch.dylib 0x222a44a38 _dispatch_call_block_and_release + 24
12 libdispatch.dylib 0x222a457d4 _dispatch_client_callout + 16
13 libdispatch.dylib 0x2229f6160 _dispatch_root_queue_drain + 680
14 libdispatch.dylib 0x2229f68d0 _dispatch_worker_thread2 + 128
15 libsystem_pthread.dylib 0x222c251b4 _pthread_wqthread + 464
16 libsystem_pthread.dylib 0x222c27cd4 start_wqthread + 4
知道如何在本地开发人员上重现崩溃或导致此崩溃的原因吗?
解决方案
感谢所有人,重写应用程序以删除所有强制解包修复了崩溃
推荐阅读
- c++ - Visual Studio 2015 - 预构建事件以确定要编译的项目
- reactjs - 在 React Native 中检测活动屏幕
- c# - C++ 等价于 C# OOP if(Boy b is Student)
- java - 使用单独提交的 Java 包提交可执行文件
- c# - VB6 与 .NET 编码问题(阿拉伯语字符)
- hql - HQL 匹配字符串百分比
- asp.net - 如何从 XML 文件将数据绑定到网格视图
- r - 在 R 中编写这个嵌套 for 循环的更好方法是什么?
- git - 将函数源代码添加到源代码控制存储库时如何正确处理 local.settings.json 文件中的机密
- delphi - Delphi Firemonkey Frames - 如何获取框架使用的事件OnEnter和OnExit