APPID: wx4bd1291507e49aad
用户提供的闪退场景:
一次典型的客户端闪退日志如下:
2019-4-25 20:43:32 [log] page pages /index/index onHide have been invoked 2019-4-25 20:43:32 [log] wx.getStorageSync api invoke 2019-4-25 20:43:32 [log] wx.getStorageSync return 2019-4-25 20:43:32 [log] wx.checkSession api invoke 2019-4-25 20:43:33 [log] page pages /my/my onLoad have been invoked 2019-4-25 20:43:33 [log] page pages /my/my onShow have been invoked //这里之后闪退 2019-4-25 20:43:41 [log] wx.getStorageSync api invoke 2019-4-25 20:43:41 [log] wx.getStorageSync return 2019-4-25 20:43:41 [log] App onLaunch have been invoked 2019-4-25 20:43:41 [log] App onShow have been invoked |
之前一直正常,排查了版本更新日志,发生闪退和上线激励广告组件的时间一致,且只有该页面加载激励广告和发生闪退,大概率是激励广告引起的。
以下广告初始化代码在onLoad中:
try { if (wx.createRewardedVideoAd == null ) { return } let videoAd = wx.createRewardedVideoAd({ adUnitId: 'adunit-xxxxxxxxxxxxxx' }) app.globalData.videoAd = videoAd videoAd.load(). catch (e => { console.log(e) if (e.errCode != 0) common.sendTick( 'ERROR' , 'vad-load' , e) that.setData({ haveVideoAd: false }) }) videoAd.onLoad(() => { //videoAd.show() console.log( 'vad onLoad' ) that.setData({ haveVideoAd: true }) }) videoAd.onError((e) => { console.log(e) that.setData({ haveVideoAd: false }) if (e.errCode != 0) common.sendTick( 'ERROR' , 'vad-onerr' , e) }) videoAd.onClose((res) => { console.log(res.isEnded) if (res.isEnded) { wx.showLoading({ title: '积分发放中' , }) common.overVideoAd().then((data) => { that.setData({ 'meta.balance' : that.data.meta.balance + that.data.meta.vadbalance }, function () { wx.hideLoading() wx.showToast({ title: '领取积分成功' , duration: 1000 }) }) }). catch ((err) => { console.log(err) wx.hideLoading() wx.showToast({ title: '很抱歉,网络出了点问题,请稍后再试' , icon: 'none' , duration: 1500 }) }) } else { wx.showToast({ title: '因未观看完毕,无法获得积分' , icon: 'none' , duration: 2000 }) } }) } catch (e) { console.log(e) if (e.errCode != 0) common.sendTick( 'ERROR' , 'vad-wrap' , e) that.setData({ haveVideoAd: false }) } |
后台没有收到上报错误信息
我这里暂时没有复现调试的条件,先反馈一下
你好,现在问题是否解决,监听下内存有没有告警https://developers.weixin.qq.com/miniprogram/dev/api/wx.onMemoryWarning.html呢?
找到了完全相同的环境进行测试,无法复现,当作偶然情况了