I need to symbolicate apple crash log
I don't have any crashes when running my app on all supported devices on XCode simulator but apple reviewer tells me that my app crashes on launching and send me this crash log if someone could symbolicating this crash log so I can find the crash. This is a link for crash-log.txt file
this is my Main VC if it helps finding crash
@IBOutlet weak var aboutBarBtn: UIBarButtonItem!
@IBOutlet weak var homeBarBtn: UIBarButtonItem!
@IBAction func homeBarBtn(_ sender: UIBarButtonItem) {
loadContent()
}
@IBOutlet weak var webView: WKWebView!
private var failedAt: URL?
private lazy var offlineImg: UIImageView = {
let image = UIImageView(image: #imageLiteral(resourceName: "90713124_3084925348192795_4212473017332137984_n"))
image.contentMode = .scaleAspectFit
return image
}()
private lazy var offlineTitleLbl: UILabel = {
let label = UILabel()
label.text = "Opps!.."
label.font = UIFont.boldSystemFont(ofSize: 18)
label.textAlignment = .center
return label
}()
private lazy var offlineMessageLbl: UILabel = {
let label = UILabel()
label.text = "We couldn't load the next page on this connection please try again"
label.font = UIFont.systemFont(ofSize: 16)
label.numberOfLines = 0
label.textAlignment = .center
return label
}()
private lazy var offlineTryAgainBtn: UIButton = {
let button = UIButton()
button.setTitle("Try Again", for: .normal)
button.setTitleColor(.systemRed, for: .normal)
button.layer.borderColor = UIColor.systemRed.cgColor
button.layer.borderWidth = 1.0
button.addTarget(self, action: #selector(self.onTryAgainBtnPressed(_:)), for: .touchUpInside)
return button
}()
private lazy var offlineView: UIView = {
let view = UIView()
return UIView()
}()
override func viewDidLoad() {
super.viewDidLoad()
homeBarBtn.image = #imageLiteral(resourceName: "home")
aboutBarBtn.image = #imageLiteral(resourceName: "info")
let center = UNUserNotificationCenter.current()
center.requestAuthorization(options: [.alert, .badge]) { (granted, error) in
if let e = error {
print ("Failed to authorize notification from user.\(e)")
}
}
let content = UNMutableNotificationContent()
content.title = "مرحباً بك في الزاوية الخامسة"
content.body = "أولي خطواتك لتحقيق أحلامك ريادة صناعة المستقبل"
let date = Date(timeIntervalSinceNow: 5)
let dateComponeent = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date)
let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponeent, repeats: false)
let uuidString = UUID().uuidString
let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger)
center.add(request) { (error) in
if let e = error {
print(e)
}
}
webView.navigationDelegate = self
start()
}
@objc func onTryAgainBtnPressed(_ sender: Any) {
self.offlineView.removeFromSuperview()
start()
}
private func start() {
if let connection = try? Reachability().connection {
switch connection {
case .cellular, .wifi:
loadContent()
default:
displayOfflineView()
}
} else {
displayOfflineView()
}
}
private func loadContent() {
if let url = failedAt {
webView.load(URLRequest(url: url))
}else if let url = URL(string: "Link here") {
webView.load(URLRequest(url: url))
} else {
displayOfflineView()
}
}
private func displayOfflineView() {
view.addSubview(offlineView)
view.bringSubviewToFront(offlineView)
offlineView.snp.makeConstraints { maker in
maker.edges.equalTo(self.view.safeAreaLayoutGuide)
}
offlineView.addSubview(offlineImg)
offlineImg.snp.makeConstraints { maker in
// maker.top.equalToSuperview().offset(30)
maker.size.equalTo(120)
maker.centerX.equalToSuperview()
}
offlineView.addSubview(offlineTitleLbl)
offlineTitleLbl.snp.makeConstraints { maker in
maker.top.equalTo(offlineImg.snp.bottom).offset(20)
maker.width.equalToSuperview().inset(40)
maker.centerX.equalToSuperview()
}
offlineView.addSubview(offlineMessageLbl)
offlineMessageLbl.snp.makeConstraints { maker in
maker.top.equalTo(offlineTitleLbl.snp.bottom).offset(8)
maker.width.equalToSuperview().inset(40)
maker.centerY.equalToSuperview()
maker.centerX.equalToSuperview()
}
offlineView.addSubview(offlineTryAgainBtn)
offlineTryAgainBtn.snp.makeConstraints { maker in
maker.top.equalTo(offlineMessageLbl.snp.bottom).offset(30)
maker.leading.trailing.equalToSuperview().inset(30)
maker.height.equalTo(50)
maker.centerX.equalToSuperview()
}
}
}
extension ViewController: WKNavigationDelegate {
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
HUD.show(.progress)
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
HUD.hide()
}
func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
self.failedAt = webView.url
HUD.flash(.labeledError(title: "Opps!..", subtitle: error.localizedDescription))
displayOfflineView()
}
}
Normally we are run and test our apps in debug mode.Sometimes apps working properly on debug mode,But will be crash on release mode. It may cause frameworks,cocoapods or other methods that we use to build our app.
go to edit scheme and change your build configuration debug to release mode. then run your app on real device.Now you get the errors that apple get If some issue have with your app.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.