ios - “在范围内找不到类型‘GADInterstitialAd’”错误
问题描述
您好,在 XCode 上归档我的应用程序时出现此错误。该应用程序在模拟器和物理设备上正常运行,但是当我尝试存档时出现此错误:
在范围内找不到类型“GADInterstitialAd”
这是 pod 文件:
pod 'Google-Mobile-Ads-SDK','~>8.0'
我也像这样导入谷歌广告:
导入 GoogleMobileAds
这是插页式实现:
GADInterstitialAd.load(withAdUnitID: NSLocalizedString("interstitial_id", comment: ""), request: request, completionHandler: {[weak self] (ad, error) in
if error != nil {
return
}
self!.interstitial = ad
self!.interstitial.fullScreenContentDelegate = self
})
解决方案
您可能正在使用旧版 API 进行插页式广告。谷歌有时会在没有正确告诉所有人的情况下更改 API。
尝试在您使用GAMInterstitialAd.load
而不是GADInterstitialAd.load
.
这是新 api 的文档:Google Intersticial API 链接
推荐阅读
- r - ggplot 条形图在 Shiny 上无法正确显示
- vba - 在 VBA 中检查 pscp 传输的结果
- android - 在应用程序关闭或打开时检测来电或响铃
- sql-server-2019 - Synapse Analytics 与 SQL Server 2019 大数据集群
- reactjs - 我想在主页上显示一个变量
- c - 为什么这些函数具有不同的时间复杂度?
- python-3.x - Python Selenium - 从无序列表中选择列表项
- reactjs - 单击React中的另一个输入框时如何更改输入值
- javascript - 如何在赛普拉斯中存根数据库查询?
- javascript - 使用 GraalVM 代替 Nashorn Engine 来使用 Jvascript 的 eval() 函数