Xcode 10 似乎打破了 com.apple.commcenter.coretelephony.xpc

Posted

技术标签:

【中文标题】Xcode 10 似乎打破了 com.apple.commcenter.coretelephony.xpc【英文标题】:Xcode 10 seems to break com.apple.commcenter.coretelephony.xpc 【发布时间】:2019-02-26 13:37:13 【问题描述】:

我已在 High Sierra 上升级到 Xcode 10,现在来自 AdMob 的 Rewarded Ad example project 抱怨 com.apple.commcenter.coretelephony.xpc 无法正常工作。

是否有我必须启用的新权利?我在没有任何线索的情况下搜索了几个小时。

更新: 这只发生在模拟器中。在设备上它工作正常。他们一定添加了新的限制。

2018-09-22 10:59:39.730813+0100 RewardedVideoExample[1449:26168] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.
2018-09-22 10:59:40.031746+0100 RewardedVideoExample[1449:26281] 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.
2018-09-22 10:59:40.031865+0100 RewardedVideoExample[1449:26261] Failed to ping server after delegate was set
2018-09-22 10:59:40.031938+0100 RewardedVideoExample[1449:26262] Failed to create synchronous 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.
2018-09-22 10:59:40.032054+0100 RewardedVideoExample[1449:26262] [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.
2018-09-22 10:59:40.032353+0100 RewardedVideoExample[1449:26262] Failed to create synchronous 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.
2018-09-22 10:59:40.032451+0100 RewardedVideoExample[1449:26262] [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.
2018-09-22 10:59:40.035631+0100 RewardedVideoExample[1449:26262] Failed to create synchronous 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.
2018-09-22 10:59:40.035714+0100 RewardedVideoExample[1449:26262] [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.
2018-09-22 10:59:40.259658+0100 RewardedVideoExample[1449:26314] WF: === Starting WebFilter logging for process RewardedVideoExample
2018-09-22 10:59:40.259805+0100 RewardedVideoExample[1449:26314] WF: _userSettingsForUser : (null)
2018-09-22 10:59:40.259876+0100 RewardedVideoExample[1449:26314] WF: _WebFilterIsActive returning: NO
2018-09-22 10:59:41.020170+0100 RewardedVideoExample[1449:26282] <Google> Cannot find an ad network adapter with the name(s): com.google.DummyAdapter. Remember to link all required ad network adapters and SDKs, and set -ObjC in the 'Other Linker Flags' setting of your build target.
Reward based video ad failed to load: No ad returned from any ad server.
2018-09-22 11:00:09.288227+0100 RewardedVideoExample[1449:26168] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /Users/houmie/Library/Developer/CoreSimulator/Devices/3FF81C00-0DA2-4F98-8964-A84F14FB14A6/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-09-22 11:00:09.289859+0100 RewardedVideoExample[1449:26168] [MC] Reading from private effective user settings.

【问题讨论】:

我在使用 AWS Cognito 时遇到了同样的问题,您解决了吗? 我必须将操作系统更新到 Mojawe 才能让它消失。 哦,好吧,在我的情况下,我意识到这个错误只发生在模拟器上,而不是真实设备上。编辑:我刚刚看到你对模拟器的编辑 是的,这很烦人,因为您必须使用您的设备进行测试,并且不能再使用模拟器了。 我的回答解决了您的问题吗? 【参考方案1】:

在终端中运行它让它消失了:

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

【讨论】:

它只是为模拟器设置一个配置,使子系统 com.apple.CoreTelephony 没有(“关闭”)日志记录。这比拒绝所有操作系统消息要好得多,因为其中一些消息(我认为自动布局警告也属于它)非常有用 @ChikabuZ 您是否安装了命令行实用程序?如果没有,请告诉我是否有帮助。如果你已经这样做了,也请告诉我。 @DepartamentoB 我安装了“Xcode 命令行工具”,但收到同样的错误。 这就像在尿渍上喷洒退热剂。它还在那里。只是闻起来更香。 不敢相信这仍然是 Xcode 11+ 上的问题。 Apple 开发人员如何不对此感到恼火,以至于无法自行修复它。【参考方案2】:

它可以在 Xcode 10.2 中的模拟器和设备上运行。

    添加 CoreTelephony.framework(可选)

    在终端中执行以下命令:

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

    从 Xcode 菜单打开:Product > Scheme > Edit Scheme

    在你的环境变量集OS_ACTIVITY_MODE = disable

    重启模拟器

【讨论】:

对我来说 OS_ACTIVITY_MODE = 禁用有效。 Xcode 10.3,莫哈韦沙漠 不错的尝试方式。 不,它不起作用,它不显示调试消息。因此也不会出现布局错误。好伤心。 只需 simctl booted log config 命令对我来说就足够了。关闭 OS_ACTIVITY_MODE 将隐藏这些以及隐藏太多的其他所有内容(包括 NSLogs)。 为我工作! (仅仅在终端运行 xcrun 是不够的)【参考方案3】:

我找到了重新启动模拟器的解决方法。

【讨论】:

【参考方案4】:

对于在真实设备中遇到此问题的用户,将 CoreTelephony.framework 链接到项目可以解决问题。

不过,它并没有为模拟器修复它。

【讨论】:

【参考方案5】:

对于在真实设备上构建时遇到此问题的人,打开设备上的 wifi 可以解决此问题。这似乎在使用蜂窝而不是 wifi 时触发。

【讨论】:

【参考方案6】:

我遇到了同样的问题,我是这样解决的: 转到标签 Build Phases 并搜索 Bundle React Native code and images 并在 shell 下方输入添加:

导出 NODE_BINARY=节点 ../node_modules/react-native/scripts/react-native-xcode.sh

这对我来说适用于 Xcode 11.3.1

希望这对某人有所帮助!

【讨论】:

以上是关于Xcode 10 似乎打破了 com.apple.commcenter.coretelephony.xpc的主要内容,如果未能解决你的问题,请参考以下文章

为啥在 iOS 10 中找不到 com.apple.nsurlsessiond 文件夹?

SwiftUI Xcode 11 beta 7 @Binding for collections 正在打破预览

Xcode10出现代码无提示无色解决方案

Xcode 5.1 打破了一些测试

Xcode 11.2.1 上的 com.apple.dt.SKAgent 消耗所有资源

com.apple.CoreData.SQLDebug 标志未显示 SQL