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

我已经在 High Sierra上升级到了 Xcode 10,现在来自 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.

Screenshot

70023 次浏览

I found a workaround restarting the simulator.

For those who are experiencing this issue in real devices, linking CoreTelephony.framework to the project fixes the problem.

It does not fix it for the simulator, though.

Running this in Terminal made it go away:

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

Well it's working on both the simulator and device in Xcode 10.2.

  1. Add CoreTelephony.framework (Optional)

  2. Executing the following command in Terminal:

    xcrun simctl spawn booted log config --mode "level:off" --subsystem
    com.apple.CoreTelephony
    
  3. From the Xcode menu open: Product > Scheme > Edit Scheme

    On your Environment Variables set OS_ACTIVITY_MODE = disable

  4. Restart simulator

I was having the same issue, and this is how I solved it: Go to the tab Build Phases and search for Bundle React Native code and images and below shell input add:

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

This worked for me with Xcode 11.3.1

Hope this helps someone!

For people facing this issue when building on real devices, turning on the wifi on the device fixed the problem. This seems to trigger when cellular is being used in stead of wifi.

Run this in Terminal,

  • 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
    

Possible mode levels: debug, info, default

Additional informations:

It's possible to set the level for "com.apple.CoreTelephony" subsystem on the system level with:

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

Silencing those logs with the OS_ACTIVITY_MODE flag will silence other system logs.

From the Xcode menu open: Product > Scheme > Edit Scheme


On your Environment Variables set OS_ACTIVITY_MODE = disable