Google play services 5.0.77

前端 未结 10 1194
我寻月下人不归
我寻月下人不归 2021-01-30 04:23

From the 25th of june two unrelated apps that are using ads started to have this NPE

java.lang.NullPointerException
   at zo.a(SourceFile:172)
   at aeh.a(SourceF         


        
10条回答
  •  囚心锁ツ
    2021-01-30 04:39

    I have find temporary semi-solution. I use thiagolr advice above with delayed ad request:

        Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            AdRequest adRequest = new AdRequest.Builder().build();
            adView.loadAd(adRequest);
            super.handleMessage(msg);
        }
    };
    
    if (handler != null) {
        handler.sendEmptyMessageDelayed(0, 200);
    }
    

    Also I removed onResume and onPause methods, so I don't know which solution helps me, but beforee this workaround I had 100-130 java.lang.NullPointerException at zo.a(SourceFile:172) per day. After this workaround I had 6-10 NullPointerException per day. If you want you could try this solutions separately to define which of them helps.

    My removed methods in activity:

    //    @Override
    //    public void onPause() {
    //      adView.pause();
    //      super.onPause();
    //    }
    //
    //    @Override
    //    public void onResume() {
    //      super.onResume();
    //      adView.resume();
    //    }
    

提交回复
热议问题