bannerAd.destroy is not a function
发布于 4 年前 作者 azhang 2616 次浏览 来自 问答

原项目代码不方便整个贴出来,摘取了部分关键代码如下:

this.bannerAd = wx.createBannerAd({
            adUnitId: 'adunit-xxxxhidexxxx',
            style: {
                left: 0,
                top: 0,
                width: 300,
                height: 100
            }
        });
        this.bannerAd.show();
 
        setTimeout(() => {
            this.bannerAd.destroy();
        }, 4000);

在 Android 手机上运行之后,会有如下错误

gameThirdScriptError
b.bannerAd.destroy is not a function;at setTimeout callback function
TypeError: b.bannerAd.destroy is not a function
at Function.<anonymous> (https://servicewechat.qq.com/game.js:120:16275)
at Function.<anonymous> (<anonymous>:4:27175)

百分百重现。

运行环境是:

小米 Mix2 手机

微信版本:6.6.7

2 回复

已经修复,再试一下

微信 6.7.0 也能重现这个问题。非常严重。不知道是不是我用错了方法。

回到顶部