可能会出现的控制台错误
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
输出到控制台的所有消息都有前缀 [Ad Placement API]
:
您只能设置 preloadAdBreaks 一次:
- 已调用
adConfig()
以设置值为 <VALUE>
的 preloadAdBreaks
已尝试调用 adBreak()
,但系统仍在处理针对 adBreak()
的另一项调用(确保您没有通过其他工作器触发广告,并且没有在回调函数中调用 adBreak()
):
Cannot show ad while another ad is already visible.
执行您提供的任意回调时失败:
<CALLBACK NAME> callback threw an error: <ERROR>
代码参数存在错误:
Invalid data-ad-frequency-hint value: '<VALUE>'. It must be in format 'Xs'
where X is a number.
Unsupported data-adbreak-test value '<VALUE>'. Supported values: 'on'.
adConfig()
参数验证错误:
Invalid ad config: <ERROR>.
。其中 <ERROR>
可以是:
preloadAdBreaks must be one of ['auto', 'on']
sound must be one of ['on', 'off']
onReady
必须是函数
adBreak()
参数验证错误:
Invalid placement config: <ERROR>
。其中 <ERROR>
可以是:
missing required properties <LIST OF PROPERTIES>
<CALLBACK NAME> must be a function
<PROPERTY NAME> must be one of <LIST OF VALID VALUES>
the following properties are not used for the given ad type:
<LIST OF PROPERTIES>
adBreak()
中重命名的回调(beforeBreak
、afterBreak
和 adComplete
)已分别重命名为 beforeAd
、afterAd
和 adViewed
。重命名后的运作方式没有变化):
Placement config: <OLD> has been renamed to <NEW>. Please update your code.
Invalid placement config: <OLD> has been renamed to <NEW>. Cannot pass both
fields. Please use <NEW> only.
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-11-22。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-11-22。"],[[["The Ad Placement API uses the prefix `[Ad Placement API]` for all console messages and allows preloading ad breaks only once using `adConfig()`."],["Developers should avoid calling `adBreak()` while another ad is displaying and ensure proper tagging parameters like `data-ad-frequency-hint` and `data-adbreak-test`."],["`adConfig()` and `adBreak()` require specific arguments, including callbacks, and will generate errors if invalid values are provided."],["Callbacks in `adBreak()` have been renamed (`beforeBreak` to `beforeAd`, `afterBreak` to `afterAd`, and `adComplete` to `adViewed`) and using the old names will result in errors."],["The API provides detailed error messages for troubleshooting, including specific reasons for failures and invalid configurations."]]],[]]