消息太多 - Web 视图被破坏。忽略动作

Too many messages - The webview is destroyed. Ignoring action

将 admob 添加到项目并使用后,当屏幕上没有任何反应且应用程序运行速度太慢时,我经常在控制台中收到此类消息。

I/Ads ( 3001): This request is sent from a test device.

W/Ads ( 3001): #004 The webview is destroyed. Ignoring action.

I/chatty ( 3001): uid=10080(com.github.testapp) identical 1 line

W/Ads ( 3001): #004 The webview is destroyed. Ignoring action.

E/eglCodecCommon( 3001): glUtilsParamSize: unknow param 0x000085b5

I/chatty ( 3001): uid=10080(com.github.testapp) RenderThread identical 18 lines

E/eglCodecCommon( 3001): glUtilsParamSize: unknow param 0x000085b5

W/Ads ( 3001): #004 The webview is destroyed. Ignoring action.

I/chatty ( 3001): uid=10080(com.github.testapp) identical 1 line

W/Ads ( 3001): #004 The webview is destroyed. Ignoring action.

I/Choreographer( 3001): Skipped 30 frames! The application may be doing too much work on its main thread.

E/eglCodecCommon( 3001): glUtilsParamSize: unknow param 0x000085b5

I/chatty ( 3001): uid=10080(com.github.testapp) RenderThread identical 88 lines

E/eglCodecCommon( 3001): glUtilsParamSize: unknow param 0x000085b5

D/EGL_emulation( 3001): eglMakeCurrent: 0xe63abce0: ver 3 0 (tinfo 0xbf992bc0)

E/eglCodecCommon( 3001): glUtilsParamSize: unknow param 0x000085b5

我是这样在无状态小部件中使用它的:

 @override
 Widget build(BuildContext context) {
    BannerAd _currentBannerAd = BannerAd(
      adUnitId: AdManager.bannerAdUnitId,
      size: AdSize.banner,
    );
    
    void _loadBannerAd() {
      _currentBannerAd
        ..load()
        ..show(anchorType: AnchorType.bottom);
    }
    
    _loadBannerAd();

    return FutureBuilder<List<String>>(...

docs 中所述,当不再需要访问广告时应调用 dispose()。应用变慢的原因可能是因为广告被多次初始化而没有被丢弃。