StrictMode policy violation:: onReadFromDisk

1,009 views
Skip to first unread message

Zeeshan Amjad

unread,
Sep 13, 2017, 7:58:23 AM9/13/17
to Google Mobile Ads SDK Developers
Hello Guys,

I am using AdMob Android SDK v11.0.0-r2 in my game which is LIVE on Google play store for sometime. I have been receiving Lots of ANR reports from Google dashboard related to Illegal I/O operations from disk. 
After doing some investigation using StrictMode enabled i figured that Admob SDK gives error when we call com.google.android.gms.ads.MobileAds.getRewardedVideoAdInstance. 
This function is being called from UIThread as per your documentation but internally it tries to do an I/O operation which may leads to an ANR. So kindly help to fix this issue. Thanks
I am pasting full stack below so it can better be addressed.

======================================================================================
StrictMode policy violation; ~duration=1025 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65567 violation=2
                                                   at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1293)
                                                   at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:240)
                                                   at java.io.File.isDirectory(File.java:804)
                                                   at dalvik.system.DexPathList.makeElements(DexPathList.java:305)
                                                   at dalvik.system.DexPathList.makePathElements(DexPathList.java:272)
                                                   at dalvik.system.DexPathList.<init>(DexPathList.java:145)
                                                   at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
                                                   at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:38)
                                                   at com.google.android.gms.dynamite.zzh.<init>(Unknown Source)
                                                   at com.google.android.gms.dynamite.DynamiteModule.zzb(Unknown Source)
                                                   at com.google.android.gms.dynamite.DynamiteModule.zzaf(Unknown Source)
                                                   at com.google.android.gms.internal.zzaje.zzas(Unknown Source)
                                                   at com.google.android.gms.internal.zzjf.zza(Unknown Source)
                                                   at com.google.android.gms.internal.zzll.getRewardedVideoAdInstance(Unknown Source)
                                                   at com.google.android.gms.ads.MobileAds.getRewardedVideoAdInstance(Unknown Source)
                                                   at com.modules.ads.AdMobSetup.<init>(AdMobSetup.java:45)
                                                   at com.modules.ads.ModuleAds$1.registerNetwork(ModuleAds.java:84)
                                                   at com.modules.ads.ModuleAds$1.handleMessage(ModuleAds.java:48)
                                                   at android.os.Handler.dispatchMessage(Handler.java:102)
                                                   at android.os.Looper.loop(Looper.java:154)
                                                   at android.app.ActivityThread.main(ActivityThread.java:6688)
                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
======================================================================================

Another Stack Trace::
StrictMode policy violation; ~duration=1053 ms: android.os.StrictMode$StrictModeCustomViolation: policy=4259871 violation=8 msg=gcore.dynamite
                                                   at android.os.StrictMode$AndroidBlockGuardPolicy.onCustomSlowCall(StrictMode.java:1266)
                                                   at android.os.StrictMode.noteSlowCall(StrictMode.java:2185)
                                                   at mre.a(:com.google.android.gms@11509448)
                                                   at com.google.android.gms.chimera.container.GmsModuleProvider.query(:com.google.android.gms@11509448:5)
                                                   at android.content.ContentProvider.query(ContentProvider.java:1027)
                                                   at android.content.ContentProvider$Transport.query(ContentProvider.java:243)
                                                   at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
                                                   at android.os.Binder.execTransact(Binder.java:573)
                                               # via Binder call with stack:
                                               android.os.StrictMode$LogStackTrace
                                                   at android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1960)
                                                   at android.os.Parcel.readExceptionCode(Parcel.java:1674)
                                                   at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:132)
                                                   at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
                                                   at android.content.ContentResolver.query(ContentResolver.java:536)
                                                   at android.content.ContentResolver.query(ContentResolver.java:478)
                                                   at com.google.android.gms.dynamite.DynamiteModule.zzd(Unknown Source)
                                                   at com.google.android.gms.dynamite.DynamiteModule.zzb(Unknown Source)
                                                   at com.google.android.gms.dynamite.DynamiteModule.zzaf(Unknown Source)
                                                   at com.google.android.gms.internal.zzaje.zzas(Unknown Source)
                                                   at com.google.android.gms.internal.zzjf.zza(Unknown Source)
                                                   at com.google.android.gms.internal.zzll.getRewardedVideoAdInstance(Unknown Source)
                                                   at com.google.android.gms.ads.MobileAds.getRewardedVideoAdInstance(Unknown Source)
                                                   at com.modules.ads.AdMobSetup.<init>(AdMobSetup.java:45)
                                                   at com.modules.ads.ModuleAds$1.registerNetwork(ModuleAds.java:84)
                                                   at com.modules.ads.ModuleAds$1.handleMessage(ModuleAds.java:48)
                                                   at android.os.Handler.dispatchMessage(Handler.java:102)
                                                   at android.os.Looper.loop(Looper.java:154)
                                                   at android.app.ActivityThread.main(ActivityThread.java:6688)
                                                   at java.lang.reflect.Method.invoke(Native Method)
                                                   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
                                                   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Sep 13, 2017, 2:16:47 PM9/13/17
to Google Mobile Ads SDK Developers
Hello Zeeshan, 

Thank you for bringing this to our notice. However, we would need some additional information to investigate the issue further. 
  • Complete stack trace
  • Detailed steps to reproduce the issue
  • Can you confirm if the issue is reproducible with our sample apps?
  • SDK version and Device used to reproduce the issue
If you could provide these details, it will help us debug the issue.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

Zeeshan Amjad

unread,
Sep 18, 2017, 1:16:43 AM9/18/17
to Google Mobile Ads SDK Developers
Hello,

Please See my response Inline

On Wednesday, September 13, 2017 at 11:16:47 PM UTC+5, Bharani Cherukuri (Mobile Ads SDK Team) wrote:
Hello Zeeshan, 

Thank you for bringing this to our notice. However, we would need some additional information to investigate the issue further. 
  • Complete stack trace
>>>>> I have already shared Stacktrace in my first post. 
  • Detailed steps to reproduce the issue
>>>>> Just Needs to enable StrictMode in MainActivity's OnCreate method of your Sample Android app using code below. 
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
  • Can you confirm if the issue is reproducible with our sample apps?
>>>>> Yes it is. 
  • SDK version and Device used to reproduce the issue
>>>>> Android SDK v11.0.0-r2 and device is Samsung Galaxy S7.

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Sep 18, 2017, 1:56:12 PM9/18/17
to Google Mobile Ads SDK Developers
Hello Zeeshan,

Thank you for getting back to support. I was able to reproduce the issue with our sample apps and our team is investigating the cause of this ANR report. Meanwhile, can you confirm if you're having any issues loading the ads as I did not have any trouble loading them on my end.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

On Wednesday, September 13, 2017 at 7:58:23 AM UTC-4, Zeeshan Amjad wrote:

Zeeshan Amjad

unread,
Sep 19, 2017, 3:40:04 AM9/19/17
to Google Mobile Ads SDK Developers
Hello Bharani,

Correct, There is no issue loading the ad on my end too.

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Sep 19, 2017, 8:58:05 AM9/19/17
to Google Mobile Ads SDK Developers
Hello Zeeshan,

Thank you for confirming this. I have shared this issue with the team and I will update this thread as soon as I have any new information.

Regards,
Bharani Cherukuri
Mobile Ads SDK Team

On Wednesday, September 13, 2017 at 7:58:23 AM UTC-4, Zeeshan Amjad wrote:

Zeeshan Amjad

unread,
Oct 5, 2017, 2:02:46 AM10/5/17
to Google Mobile Ads SDK Developers
Do we have any update on this?

Bharani Cherukuri (Mobile Ads SDK Team)

unread,
Oct 5, 2017, 2:52:16 PM10/5/17
to Google Mobile Ads SDK Developers
Hello Zeeshan, 

Thank you for following up. We do not have any update at this time. I will follow up on this thread if I have any new information.

Thanks,
Bharani Cherukuri
Mobile Ads SDK Team

On Wednesday, September 13, 2017 at 7:58:23 AM UTC-4, Zeeshan Amjad wrote:
Reply all
Reply to author
Forward
0 new messages