-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StrictMode DiskReadViolation during initialization #276
Comments
@HGaurav328 we created internal bug ticket for this. |
Hi Any update on it or can we initialization NewRelic in background thread. |
@HGaurav328 we are working on it, we will fix it for next release. |
@HGaurav328 Thank you for raising this issue, upon investigating, could you help me with few questions? I noticed with your implementation
All the violations happen within NR library shouldn't be affecting your functionality of the application, since they are just logs(noise) that indicate places are running in the main thread within the NR library. Is this true?
|
No We just enable StrictMode on debug build. because we got lots of ANR from crashlytics dashboard which related to NewRelic sdk. we attached crashlytics logs file. |
@HGaurav328 this anr issue is already fixed in 7.4.0 and higher agent version. |
Hey all.
We are using below version of the SDK inside our app.
com.newrelic.agent.android:agent-gradle-plugin:7.5.1,
com.newrelic.agent.android:android-agent:7.5.1
During the initialization of the SDK with StrictMode enabled like so:
StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build())
StrictMode policy violation; ~duration=88 ms: android.os.strictmode.DiskReadViolation (Ask Gemini)
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1666)
at libcore.io.BlockGuardOs.access(BlockGuardOs.java:74)
at libcore.io.ForwardingOs.access(ForwardingOs.java:128)
at android.app.ActivityThread$AndroidOs.access(ActivityThread.java:8054)
at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:313)
at java.io.File.exists(File.java:813)
at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:790)
at android.app.ContextImpl.ensurePrivateDirExists(ContextImpl.java:781)
at android.app.ContextImpl.getFilesDir(ContextImpl.java:826)
at android.content.ContextWrapper.getFilesDir(ContextWrapper.java:286)
at com.newrelic.agent.android.util.OfflineStorage.(OfflineStorage.java:26)
at com.newrelic.agent.android.AndroidAgentImpl.(AndroidAgentImpl.java:119)
at com.newrelic.agent.android.AndroidAgentImpl.init(AndroidAgentImpl.java:636)
at com.newrelic.agent.android.NewRelic.start(NewRelic.java:301)
at com.viewlift.hoichoi.datasource.startup.NewRelicInitializer.initializeNewRelic(NewRelicInitializer.kt:27)
at com.viewlift.hoichoi.datasource.startup.NewRelicInitializer.create(NewRelicInitializer.kt:12)
at com.viewlift.hoichoi.datasource.startup.NewRelicInitializer.create(NewRelicInitializer.kt:9)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:138)
at androidx.startup.AppInitializer.initializeComponent(AppInitializer.java:117)
at com.viewlift.hoichoi.App.onAppInitializer(App.kt:61)
at com.viewlift.hoichoi.App.onCreate(App.kt:53)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1316)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6998)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2236)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
The text was updated successfully, but these errors were encountered: