8

I have some ANR's error reported on Google Play Console. I turn on Strict Mode like this:

StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build());
        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                .detectAll()
                .penaltyLog()
                .build());

And I've noticed violations only in AdMob method:

MobileAds.initialize(this, "YOUR_ADMOB_APP_ID");

and:

   interstitialAd.loadAd(adReqest);

Error logs on MobileAds.initialize():

StrictMode policy violation; ~duration=827 ms: 
android.os.StrictMode$StrictModeDiskReadViolation:

and on InterstitialAd.loadAd():

stack=android.os.StrictMode$StrictModeCustomViolation: 
policy=4259871 violation=8 msg=gcore.dynamite
    at android.os.StrictMode$AndroidBlockGuardPolicy.onCustomSlowCall(StrictMode.java:1280)
    at android.os.StrictMode.noteSlowCall(StrictMode.java:2225)

I'd like to ask if have anybody discovered that issues? If yes, is it possible that errors can provide to ANR's? How to remove this issues?

Wrobel
  • 1,042
  • 12
  • 21
  • Similar: https://stackoverflow.com/questions/38930737/adview-loadad-triggering-a-strictmode-violation – Kenumir Apr 30 '19 at 06:29
  • 2
    It should be noted that the referenced https://stackoverflow.com/questions/38930737/adview-loadad-triggering-a-strictmode-violation is only offering an answer to the violation about the disk reads. It does not offer an answer on the second part, the slow UI calls. – Ecthelion Nov 30 '20 at 11:37

0 Answers0