Apple团队对其进行审核时,该应用程序崩溃了,但在开发时无法重现崩溃。
我尝试在所有可能的模拟器中运行它,还尝试了Amazon AWS Device Farm和2种不同的真实设备(iPad和iPhone)。
在我们解析其他字段但没有日期之前,DateFormater似乎无法解析日期并返回nil。
我们认为格式应符合规定(我们可以在设备上进行解析),并且使用与Apple审核小组相同的帐户。
我们还尝试过将日历切换为非公历,这也不会导致应用程序崩溃。
该应用在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
有什么主意如何在本地开发人员上重现崩溃或什么原因会导致崩溃?
答案 0 :(得分:0)
感谢所有人, 重写该应用程序以消除所有强制展开问题,从而解决了崩溃问题