Crashed: com.apple.root.default-qos

Isuru picture Isuru · Mar 10, 2017 · Viewed 8.1k times · Source

I have a fairly simple app that parses a RSS feed and shows it's content in a table view. It's available on the App Store. I have Crashlytics crash reporting integrated. I recently received two reports. These are a little difficult to decipher.

This has occurred in an iPhone 6 running iOS 10.2.1.

enter image description here

This is from an iPhone 5 running iOS 10.2.1.

enter image description here

Even though it says it's crashing due to privacy violations, I'm not accessing any services that requires permission in my app.

Also searching on com.apple.root.default-qos lead me to believe that this may have something to do with background threads. The only place where I use a background thread is to parse the RSS feed data.

DispatchQueue.global(qos: .background).async {

    guard let data = try? Data(contentsOf: URL) else {
        return
    }

    do {
        let xmlDoc = try AEXMLDocument(xml: data)

        if let items = xmlDoc.root["channel"]["item"].all {
            self.posts.removeAll()

            for item in items {
                let title = item["title"].value ?? ""
                // ...
                self.posts.append(jobPost)
            }

            DispatchQueue.main.async {
                self.saveposts(self.posts)
                self.posts.sort { $0.publishDate > $1.publishDate }
                self.tableView.reloadData()
                UIApplication.shared.toggleNetworkActivityIndicator(show: false)
                self.toggleUI(enable: true)
                if self.refreshControl.isRefreshing { self.refreshControl.endRefreshing() }
            }

        }

    } catch let error as NSError {
        print("RSS parsing failed: \(error)")
        self.showErrorAlert(error)
        UIApplication.shared.toggleNetworkActivityIndicator(show: false)
        self.toggleUI(enable: true)
        if self.refreshControl.isRefreshing { self.refreshControl.endRefreshing() }
    }
}

I tested this code on my iPhone 5 running iOS 9.3.5 and simulators running iOS 10.2 but no crash occurred.

Is there any other way to track down this problem?

Answer

Chase Roberts picture Chase Roberts · Oct 16, 2017

I would double check all your permissions. In my case, starting with iOS10 you need permissions to save stuff to the user's camera roll. In my app, I was showing a default share sheet and whenever a user selected "save photo" the app crashed with one of these very not helpful error messages. I added

<key>NSPhotoLibraryAddUsageDescription</key>
    <string>Allow you to save charts and graphs from the app to your phone.</string>

to my info.plist, clean & run. And everything the problem was solved.