29

Im getting the error in the title when I run my app. I am running Xcode Beta 10 Version 6. The full error is:

[NetworkInfo] Descriptors query returned error: Error Domain=NSCocoaErrorDomain Code=4099 “The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.” UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.}

It gets thrown in my createTaskFromSnapshot() function, on the first line of the function.

My code:

func observeDatabase(_ tableToUpdate: UITableView) {
    taskDatabase.observe(.childAdded) { (snapshot) in
        self.handleChildAdded(snapshot: snapshot)
        tableToUpdate.reloadData()
    }
}

private func handleChildAdded(snapshot: 
    let addedTask = createTaskFromSnapshot(snapshot)
    taskList.append(addedTask)
}

private func createTaskFromSnapshot(_ snapshot: DataSnapshot) -> Task {
    let snapshotValue = snapshot.value as! Dictionary<String, String> // error is thrown here

    let taskTitle = snapshotValue["taskTitle"]!
    let newTask = Task(title: taskTitle)
  return newTask
}

What does this error mean? and why am I getting it?

7
  • The error and the code in your question seem unrelated to me. What makes you think the error is caused by this code? Commented Sep 1, 2018 at 13:57
  • Looks unrelated to me as well. I copy and pasted your code into my app (changing Task to a String for testing) and it worked fine. As a suggestion, I would change Dictionary<String, String> to [String: Any] unless you know for certain every node will contain key:value pairs of String:String Commented Sep 1, 2018 at 14:02
  • Thats the line Xcode highlights as the error. Each task is stored as Dictionary<String, String> Commented Sep 1, 2018 at 15:58
  • Good. Then issue may be that one of your values isn't a string but you are trying to force it to be. I would change it per my comment above and then either add error handling code for when its not a string or print out your values and try to spot one that its't. Commented Sep 2, 2018 at 13:13
  • 1
    Anyone find a solution? Getting same error message; Launch Screen appears, then app crashes. ...Failed to create remote object proxy: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service named com.apple.commcenter.coretelephony.xpc was invalidated.} ...Failed to ping server after delegate was set ...Failed to create synchronous remote object proxy: [NetworkInfo] Descriptors query returned error Commented Sep 27, 2018 at 3:21

3 Answers 3

17

The message is probably unrelated to the crash/issue.

I've had this message bother me for a while now with no way of removing it. Well I've found a way to hide this in your xcode console just run one of the following command in a terminal:

xcrun simctl spawn booted log config --mode "level:off" --subsystem com.apple.CoreTelephony

sudo log config --mode "level:off" --subsystem com.apple.CoreTelephony

you can always re-enable this at anytime by running the same command with a different level attribute`

Sign up to request clarification or add additional context in comments.

6 Comments

@Dhruv are you referencing the error mentioned in first message ? Are you using a device or simulator ?
This is an EXCELLENT solution to the CoreTelephony log issue, which is what brought me here. Didn't know you could configure the simulator log in that manner.
@DougBoutwell might I suggest you dig more into the suggest then. OsLog as since evolved greatly. There now unified logging which is great and can be implemented w/ signposts metric, reports, categories, sub-services and more. You can find more on site like avanderlee or swiftbysundell or directly at developer.apple.com
these commands don't seem to solve this issue on Xcode 16.1
@grantespo unfortunately it seems apple disabled the off level in os_log starting Xcode 15 or something. I've been struggling with/ this also recently even though man log still list the off log-level as an option :(
|
9

Try this:

1- From Xcode menu open: Product > Scheme > Edit Scheme

2- On your Environment Variables set OS_ACTIVITY_MODE = disable

enter image description here

2 Comments

This error comes while debugging in a simulator. Should remove in the actual device?
it disables almost everything including NSLog's too
2

In my case this type of warning was generated in the case when CTTelephonyNetworkInfo() was used. As this error only generated on simulator I did like this:

#if targetEnvironment(simulator)
    return []
#else
    let networkInfo = CTTelephonyNetworkInfo()
    return [networkInfo.subscriberCellularProvider]
#endif

1 Comment

This answer is not related to this question actually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.