You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an ANR related issue and have filled out the "ANR Reporting" section below.
Standard Reporting
What version of the Braze Android SDK are you using?
It has initially occurred in Xamarin bindings version 1.21.0, which binds to Braze Android SDK v13.0.0, but also reproducible on the native Android SDK v17.0.0.
What did you do?
Enabled StrictMode in my Xamarin app, then did the same on the com.braze.firebasepush sample from this repository.
What did you expect to happen?
No StrictMode errors when opening the app clicking on a push notification message.
What happened instead?
A bunch of StrictModeDiskReadViolation errors like the following logged:
StrictMode: StrictMode policy violation; ~duration=158 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.getDataDir(ContextImpl.java:2197)
StrictMode: at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:517)
StrictMode: at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:714)
StrictMode: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:368)
StrictMode: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
StrictMode: at bo.app.q4.<init>(SourceFile:5)
StrictMode: at com.appboy.Appboy.getSdkEnablementProvider(SourceFile:2)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:5)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
All errors
StrictMode: StrictMode policy violation; ~duration=158 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.getDataDir(ContextImpl.java:2197)
StrictMode: at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:517)
StrictMode: at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:714)
StrictMode: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:368)
StrictMode: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
StrictMode: at bo.app.q4.<init>(SourceFile:5)
StrictMode: at com.appboy.Appboy.getSdkEnablementProvider(SourceFile:2)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:5)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
StrictMode: StrictMode policy violation; ~duration=152 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:572)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:563)
StrictMode: at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:519)
StrictMode: at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:714)
StrictMode: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:368)
StrictMode: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
StrictMode: at bo.app.q4.<init>(SourceFile:5)
StrictMode: at com.appboy.Appboy.getSdkEnablementProvider(SourceFile:2)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:5)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
StrictMode: StrictMode policy violation; ~duration=143 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at android.app.SharedPreferencesImpl.awaitLoadedLocked(SharedPreferencesImpl.java:234)
StrictMode: at android.app.SharedPreferencesImpl.getBoolean(SharedPreferencesImpl.java:293)
StrictMode: at bo.app.q4.a(SourceFile:1)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:5)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
StrictMode: StrictMode policy violation; ~duration=138 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:572)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:563)
StrictMode: at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:519)
StrictMode: at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:714)
StrictMode: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:368)
StrictMode: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
StrictMode: at com.braze.configuration.RuntimeAppConfigurationProvider.<init>(SourceFile:2)
StrictMode: at com.braze.configuration.CachedConfigurationProvider.<init>(SourceFile:6)
StrictMode: at com.braze.configuration.CachedConfigurationProvider.<init>(SourceFile:1)
StrictMode: at com.braze.configuration.BrazeConfigurationProvider.<init>(SourceFile:1)
StrictMode: at com.appboy.Appboy.getConfiguredApiKey(SourceFile:1)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:6)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
StrictMode: StrictMode policy violation; ~duration=123 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.getDataDir(ContextImpl.java:2197)
StrictMode: at android.app.ContextImpl.getCacheDir(ContextImpl.java:659)
StrictMode: at android.content.ContextWrapper.getCacheDir(ContextWrapper.java:262)
StrictMode: at com.appboy.lrucache.AppboyLruImageLoader.getDiskCacheDir(SourceFile:1)
StrictMode: at com.appboy.lrucache.AppboyLruImageLoader.<init>(SourceFile:17)
StrictMode: at com.braze.images.DefaultBrazeImageLoader.<init>(SourceFile:1)
StrictMode: at com.appboy.Appboy.<init>(SourceFile:59)
StrictMode: at com.braze.Braze.<init>(SourceFile:1)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:7)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
StrictMode: StrictMode policy violation; ~duration=121 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:572)
StrictMode: at android.app.ContextImpl.ensurePrivateCacheDirExists(ContextImpl.java:568)
StrictMode: at android.app.ContextImpl.getCacheDir(ContextImpl.java:661)
StrictMode: at android.content.ContextWrapper.getCacheDir(ContextWrapper.java:262)
StrictMode: at com.appboy.lrucache.AppboyLruImageLoader.getDiskCacheDir(SourceFile:1)
StrictMode: at com.appboy.lrucache.AppboyLruImageLoader.<init>(SourceFile:17)
StrictMode: at com.braze.images.DefaultBrazeImageLoader.<init>(SourceFile:1)
StrictMode: at com.appboy.Appboy.<init>(SourceFile:59)
StrictMode: at com.braze.Braze.<init>(SourceFile:1)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:7)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
StrictMode: StrictMode policy violation; ~duration=111 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:572)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:563)
StrictMode: at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:519)
StrictMode: at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:714)
StrictMode: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:368)
StrictMode: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
StrictMode: at bo.app.l3.<init>(SourceFile:2)
StrictMode: at com.appboy.Appboy.<init>(SourceFile:66)
StrictMode: at com.braze.Braze.<init>(SourceFile:1)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:7)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
StrictMode: StrictMode policy violation; ~duration=104 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:572)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:563)
StrictMode: at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:519)
StrictMode: at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:714)
StrictMode: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:368)
StrictMode: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
StrictMode: at bo.app.l0.<init>(SourceFile:2)
StrictMode: at com.appboy.Appboy.<init>(SourceFile:67)
StrictMode: at com.braze.Braze.<init>(SourceFile:1)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:7)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
StrictMode: StrictMode policy violation; ~duration=96 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65599 violation=2
StrictMode: at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1440)
StrictMode: at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:251)
StrictMode: at java.io.File.exists(File.java:807)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:572)
StrictMode: at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:563)
StrictMode: at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:519)
StrictMode: at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:714)
StrictMode: at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:368)
StrictMode: at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:167)
StrictMode: at bo.app.c4.<init>(SourceFile:3)
StrictMode: at com.appboy.Appboy.<init>(SourceFile:69)
StrictMode: at com.braze.Braze.<init>(SourceFile:1)
StrictMode: at com.appboy.Appboy.getInstance(SourceFile:7)
StrictMode: at com.braze.Braze.getInstance(SourceFile:1)
StrictMode: at com.braze.push.BrazeNotificationUtils.handleNotificationOpened(BrazeNotificationUtils.java:83)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.performWork(BrazePushReceiver.java:121)
StrictMode: at com.braze.push.BrazePushReceiver$PushHandlerRunnable.run(BrazePushReceiver.java:87)
StrictMode: at com.braze.push.BrazePushReceiver.handleReceivedIntent(BrazePushReceiver.java:69)
StrictMode: at com.braze.push.NotificationTrampolineActivity.onResume(NotificationTrampolineActivity.java:49)
StrictMode: at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1355)
StrictMode: at android.app.Activity.performResume(Activity.java:7117)
StrictMode: at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3556)
StrictMode: at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3621)
StrictMode: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2862)
StrictMode: at android.app.ActivityThread.-wrap11(Unknown Source:0)
StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
StrictMode: at android.os.Looper.loop(Looper.java:164)
StrictMode: at android.app.ActivityThread.main(ActivityThread.java:6494)
StrictMode: at java.lang.reflect.Method.invoke(Native Method)
StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
The disk reads take about 150 ms each in the sample app. In my production app they take up to 400 ms, probably because the app is heavier overall and utilizes disk from its side too.
I believe it can cause performance issues and even ANRs in some cases. Actually, there are even more scenarios of disk reads from the main thread, e.g. triggered by the BrazeActivityLifecycleCallbackListener in runtime, or simple calls to Braze.getInstance when performed from the main thread. Although those specific ones I mentioned above concern me more as they can slow down the app start, it would be really great to get rid of all of them, perhaps providing an async API that would delegate disk accesses to background threads.
Steps to reproduce
Go to the FirebaseApplication within the com.braze.firebasepush sample
Add StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); into the onCreate method
Deploy the sample onto a device, receive a push notifiction
Tap the push notification and look into the logcat while the app launches
Are you doing any feature customizations that may relate to the issue? Can you share the code snippet?
We do have ANRs occurred in NotificationTrampolineActivity and BrazePushReceiver, although there are no stack traces attached, so I cannot confidently say that the disk reads are the reason.
The text was updated successfully, but these errors were encountered:
Apologies for the long lead time after the holidays in responding. We have several background thread strategies in the SDK and moving these calls to utilize them shouldn't be too difficult. We will update this issue once a fix is available/released.
SDK 19.0.0 directly addresses the ANR issues in the SDK. However, the kotlin coroutine issue (Kotlin/kotlinx.coroutines#3180) our team raised is still present so depending on your version of kotlin coroutines you still may continue to see issues.
Please update your kotlin coroutine version to 1.6.1+ and Braze Android 19.0.0+ to resolve the issue. See Kotlin/kotlinx.coroutines#3180 for more information.
Standard Reporting
What version of the Braze Android SDK are you using?
It has initially occurred in Xamarin bindings version 1.21.0, which binds to Braze Android SDK v13.0.0, but also reproducible on the native Android SDK v17.0.0.
What did you do?
Enabled StrictMode in my Xamarin app, then did the same on the
com.braze.firebasepush
sample from this repository.What did you expect to happen?
No StrictMode errors when opening the app clicking on a push notification message.
What happened instead?
A bunch of StrictModeDiskReadViolation errors like the following logged:
All errors
The disk reads take about 150 ms each in the sample app. In my production app they take up to 400 ms, probably because the app is heavier overall and utilizes disk from its side too.
I believe it can cause performance issues and even ANRs in some cases. Actually, there are even more scenarios of disk reads from the main thread, e.g. triggered by the
BrazeActivityLifecycleCallbackListener
in runtime, or simple calls toBraze.getInstance
when performed from the main thread. Although those specific ones I mentioned above concern me more as they can slow down the app start, it would be really great to get rid of all of them, perhaps providing an async API that would delegate disk accesses to background threads.Steps to reproduce
FirebaseApplication
within thecom.braze.firebasepush
sampleStrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
into theonCreate
methodAre you doing any feature customizations that may relate to the issue? Can you share the code snippet?
Only enabling StrictMode as described above.
Project that demonstrates the issue
https://github.com/Appboy/appboy-android-sdk/tree/master/samples/firebase-push
ANR Reporting
We do have ANRs occurred in
NotificationTrampolineActivity
andBrazePushReceiver
, although there are no stack traces attached, so I cannot confidently say that the disk reads are the reason.The text was updated successfully, but these errors were encountered: