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

8

我已经在Mojave上升级到Xcode 11.1,现在来自FacebookSDK的奖励广告示例项目报错,提示com.apple.commcenter.coretelephony.xpc未能正确工作。

PodFile

# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'

target 'testapps' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for testapps

  pod 'FacebookCore'
  pod 'FacebookLogin'
  pod 'FacebookShare'
  pod 'FBSDKPlacesKit'
  pod 'FBAudienceNetwork'

end

使用方法

import UIKit
import FBAudienceNetwork

class ViewController: UIViewController,FBRewardedVideoAdDelegate {

    var rewardedVideoAd : FBRewardedVideoAd!
    var rewardVideoid : String! = "12345678_12345678"

    override func viewDidLoad() {
        super.viewDidLoad()
        loadRewardedVideoAd()
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }  

    func loadRewardedVideoAd(){
        self.rewardedVideoAd = FBRewardedVideoAd(placementID: rewardVideoid)
        self.rewardedVideoAd.delegate = self
        self.rewardedVideoAd.load()

    }

    func showRewardedVideoAd(){
        if (self.rewardedVideoAd != nil) && self.rewardedVideoAd.isAdValid {
            self.rewardedVideoAd.show(fromRootViewController: self)
        }
    }

    @IBAction func buttonclick(_ sender: UIButton) {
        showRewardedVideoAd()
    }


}

应用代理

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {



    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        FBAdSettings.addTestDevice(FBAdSettings.testDeviceHash())
        return true
    }
    func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
        let appId: String = "12345678"
        if url.scheme != nil && url.scheme!.hasPrefix("fb\(appId)") && url.host ==  "authorize" {
            return ApplicationDelegate.shared.application(app, open: url, options: options)
        }
        return false
    }
   ...
}

错误信息如下:
2019-11-22 14:22:12.043889+0900 testapps[12788:336635] <Warning>: You haven't set a value for FacebookAdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-ios#disable-auto-events.
2019-11-22 14:22:12.152873+0900 testapps[12788:336635] FBSDKLog: Unable to find a valid UIWindow
2019-11-22 14:22:12.584222+0900 testapps[12788:336777] [logging] table tokens already exists in "CREATE TABLE tokens(                                                  tokenId TEXT PRIMARY KEY NOT NULL,                                                  token TEXT                                              );"
2019-11-22 14:22:12.584479+0900 testapps[12788:336777] [logging] table events already exists in "CREATE TABLE events(                                                 eventId TEXT PRIMARY KEY NOT NULL,                                                 tokenId TEXT REFERENCES tokens ON UPDATE CASCADE ON DELETE RESTRICT,                                                 priority BIGINT,                                                 type TEXT,                                                 time DOUBLE,                                                 sessionId TEXT,                                                 sessionStartTime DOUBLE,                                                 data TEXT,                                                 attempt BIGINT                                             );"
2019-11-22 14:22:12.606060+0900 testapps[12788:336635] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600000332480> F8BB1C28-BAE8-11D6-9C31-00039315CD46
2019-11-22 14:22:14.348231+0900 testapps[12788:336635] [ProcessSuspension] 0x115da8240 - ProcessAssertion::processAssertionWasInvalidated()
2019-11-22 14:22:14.352725+0900 testapps[12788:336635] [ProcessSuspension] 0x115da82a0 - ProcessAssertion::processAssertionWasInvalidated()
Video ad is loaded and ready to be displayed
2019-11-22 14:22:21.641634+0900 testapps[12788:336970] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-11-22 14:22:21.641691+0900 testapps[12788:336965] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-11-22 14:22:21.641869+0900 testapps[12788:336965] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-11-22 14:22:21.643246+0900 testapps[12788:336970] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-11-22 14:22:21.643339+0900 testapps[12788:336965] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-11-22 14:22:21.644317+0900 testapps[12788:336970] [Client] Synchronous remote object proxy returned error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescriptio2019-11-22 14:22:21.644513+0900 testapps[12788:336965] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
n=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-11-22 14:22:21.693243+0900 testapps[12788:336965] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-11-22 14:22:21.695674+0900 testapps[12788:336965] [Client] Updating selectors after delegate removal failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-11-22 14:22:28.394554+0900 testapps[12788:336635] [ProcessSuspension] 0x115d733f0 - ProcessAssertion::processAssertionWasInvalidated()
2019-11-22 14:22:28.481385+0900 testapps[12788:336635] [ProcessSuspension] 0x115d73450 - ProcessAssertion::processAssertionWasInvalidated()
Rewarded Video ad video complete - this is called after a full video view, before the ad end card is shown. You can use this event to initialize your reward
2019-11-22 14:22:44.211893+0900 testapps[12788:336635] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2019-11-22 14:22:44.212632+0900 testapps[12788:336635] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service
2019-11-22 14:22:58.041772+0900 testapps[12788:336635] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service
2019-11-22 14:22:58.049248+0900 testapps[12788:336635] Could not signal service com.apple.WebKit.Networking: 113: Could not find specified service

哪里使用有误?如何解决这个问题?

当我在我的项目中添加FBAudienceNetwork.framework时,遇到了相同的问题。如何解决这个问题? - Rushabh
这个问题是否得到了解答?Xcode 10似乎破坏了com.apple.commcenter.coretelephony.xpc - Blazej SLEBODA
2个回答

8

消除iOS模拟器日志噪声

这导致了一大堆stackoverflow问题,建议您通过在目标架构中设置OS_ACTIVITY_MODE=disable来完全禁用os_log。这对某些情况可能是可以接受的,但也可能会消除一些实际有用的日志,或者如果您想使用os_log的功能集来记录自己的日志,则会消除您自己的日志。

更多信息请查看此链接,同时这个链接也会很有用。

尝试运行此命令。

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

要启用它,您可以运行以下命令:

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

或者

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

11
你能为这个解决方案添加说明吗?这个命令要做什么?只有一行代码的回答是无效的。谢谢。 - Starsky
4
这并没有解决问题,只是隐藏了日志。 - Joule87
@Same7Farouk,我该如何重新激活日志记录? - Anirudha Mahale
@Starsky,感谢您的反馈,我已经更新了答案,希望对您有所帮助。 - Same7Farouk
@AnirudhaMahale,请检查更新的答案,希望能有所帮助。 - Same7Farouk

0
我在将Admob添加到我的React Native应用程序时遇到了这个错误。
在您的Info.plist文件中添加带有布尔键和值为true的GADIsAdManagerApp。

没有解决这个问题。 - ykonda
@ykonda,您不需要给出负分。我发布的解决方案对我有用。它可能会帮助一些人忘记在他们的info.plist中添加“GADIsAdManagerApp”键。 - Phd. Burak Öztürk

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