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

119

我已经将 Xcode 10 升级到 High Sierra 上,并且现在来自 AdMob 的激励广告示例项目 报告说 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.

截图


3
我也遇到了AWS Cognito的同样问题,你解决了吗? - YoanGJ
我不得不升级操作系统到Mojawe才能解决这个问题。 - Houman
哦,好的,在我的情况下,我意识到这个错误只发生在模拟器上,而不是真实设备上。编辑:我刚看到你关于模拟器的编辑。 - YoanGJ
是的,这很烦人,因为你必须使用你的设备进行测试,不能再使用模拟器了。 - Houman
我的回答解决了你的问题吗? - Lucas van Dongen
我不再拥有High Sierra来测试这个。我以诚信接受你的答案。:) 谢谢 - Houman
7个回答

211

在终端中运行这个命令可以让它消失:

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

5
它只是为模拟器设置一个配置,让子系统com.apple.CoreTelephony不进行任何(“关闭”)日志记录。这比拒绝所有操作系统消息要好得多,因为其中一些消息(我认为自动布局警告也属于其中之一)确实很有用。 - Lucas van Dongen
4
我已经安装了“Xcode命令行工具”,但我收到了相同的错误提示。 - ChikabuZ
38
这就像在尿渍上喷香水一样,虽然闻起来更舒适了,但尿渍仍然存在。 - GeneCode
27
难以置信这个问题在Xcode 11+上仍然存在。苹果的开发人员为何不会对此感到烦恼并加以解决,这一点让我无法理解。 - Aaron
3
有没有办法重新打开它?"level:on"是无效的模式。 - Chucky
显示剩余3条评论

17

Xcode 10.2模拟器和设备上都可以正常工作。

  1. 添加CoreTelephony.framework(可选)

  2. 在终端中执行以下命令:

xcrun simctl spawn booted log config --mode "level:off" --subsystem 
com.apple.CoreTelephony
  • 从Xcode菜单中打开:Product > Scheme > Edit Scheme

    在您的环境变量中设置OS_ACTIVITY_MODE = disable

  • 重新启动模拟器


  • 6
    对我来说,OS_ACTIVITY_MODE = disable 起作用了。Xcode 10.3,Mojave。 - ashishn
    6
    不,它不起作用,也没有显示调试信息。因此布局错误也不会出现,太遗憾了。 - Burcu Kutluay
    4
    仅仅运行 simctl booted log config 命令已经足够了。关闭 OS_ACTIVITY_MODE 将会隐藏这些信息以及其他所有日志(包括 NSLogs),这样会隐藏太多内容。 - Carl Lindberg
    对我有用!(仅在终端中运行xcrun是不够的) - Peter

    9
    我找到了一个解决方案,重启模拟器即可。

    8

    在终端中运行此命令:

    • to disappear those log messages

        xcrun simctl spawn booted log config --mode "level:off" --subsystem com.apple.CoreTelephony
      
    • to appear those log messages:

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

    可能的模式级别:关闭(off)、调试(debug)、信息(info)、默认(default)

    附加信息:

    可以在系统级别上使用以下方式设置“com.apple.CoreTelephony”子系统的级别:

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

    使用OS_ACTIVITY_MODE标志来静默这些日志也将静默其他系统日志。

    From the Xcode menu open: Product > Scheme > Edit Scheme
    
    On your Environment Variables set OS_ACTIVITY_MODE = disable
    

    7

    对于那些在真实设备上遇到这个问题的人,将 CoreTelephony.framework 链接到项目中可以解决问题。

    但是这并不能解决模拟器上的问题。


    3

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


    对我来说,这种情况通常发生在我需要调试一个用户频繁在WiFi和4G之间切换连接的场景时,有没有其他的解决办法呢? - undefined

    -3
    我曾经遇到过同样的问题,这是我的解决办法: 进入选项卡Build Phases并搜索Bundle React Native code and images,在shell输入框下方添加以下内容:

    export NODE_BINARY=node ../node_modules/react-native/scripts/react-native-xcode.sh

    我用Xcode 11.3.1测试通过。
    希望能对大家有所帮助!

    网页内容由stack overflow 提供, 点击上面的
    可以查看英文原文,
    原文链接