ios - Google AdMob - “在没有应用程序 ID 的情况下初始化”错误
问题描述
我正在尝试在我的应用中使用 Google AdMob。但是,该应用程序在启动时不断崩溃。我相信我已经正确初始化了 AdMob,因为我在GADApplicationIdentifier
我的文件中添加了所需的键和值Info.plist
,而且我也GADMobileAds.sharedInstance().start(completionHandler: nil)
有AppDelegate.swift
.
这是我的错误日志:
2019-10-02 00:23:18.731486-0400 App Name[15066:162231] [Crashlytics] Version 3.14.0 (144)
2019-10-02 00:23:18.741556-0400 App Name[15066:162311] [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-10-02 00:23:18.742118-0400 App Name[15066:162335] [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-10-02 00:23:18.743045-0400 App Name[15066:162335] [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-10-02 00:23:18.746628-0400 App Name[15066:162311] [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-10-02 00:23:18.746676-0400 App Name[15066:162336] [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-10-02 00:23:18.747969-0400 App Name[15066:162311] [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-10-02 00:23:18.748361-0400 App Name[15066:162337] [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-10-02 00:23:18.787064-0400 App Name[15066:162231] *** Terminating app due to uncaught exception 'GADInvalidInitializationException', reason: 'The Google Mobile Ads SDK was initialized without an application ID. Google AdMob publishers, follow instructions here: https://googlemobileadssdk.page.link/admob-ios-update-plist to set GADApplicationIdentifier with a valid App ID. Google Ad Manager publishers, follow instructions here: https://googlemobileadssdk.page.link/ad-manager-ios-update-plist'
这适用于 Swift 5 和 iOS 13。
解决方案
推荐阅读
- html - 如何将位置固定的子级放在位置固定的父级滚动条的顶部?
- c# - C#如何通过代码生成在接下来的5分钟内有效的令牌
- sage - 在 SageMath 中定义分段函数 f(x,y)
- javascript - 我可以更改 django-filters 的 datetime-local 格式吗?
- javascript - 刻度间隔未正确设置
- ios - 如何更新云火库中不同集合中的相同数据?
- python - 索引字典列表时,“只能在某些 xcontent 字节或压缩的 xcontent 字节上调用压缩器检测”错误
- python - 在python中遇到一个脚本遍历数据的int错误,如何解决?
- c++ - g++ 编译包含的头文件:没有这样的文件或目录
- python - 如何在python中将数字添加到数据时间变量?