question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash with RuntimeException: StrictMode ThreadPolicy violation

See original GitHub issue

✍️ Describe the bug

I’m using Chucker in an app with Dagger 2 and Android’s StrictMode with the option StrictMode.ThreadPolicy.Builder().detectDiskWrites(), and I get the following crash: java.lang.RuntimeException: StrictMode ThreadPolicy violation pointing to my this code in my NetworkModule:

@Provides
@Singleton
fun provideChuckerInterceptor(context: Context): ChuckerInterceptor = ChuckerInterceptor(context)

Nevertheless removing the detectDiskWrites() removes the crash, but I still want to have this option enabled for my app.

Thanks for the great library!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cortinicocommented, Aug 23, 2020

When will 3.3.0 be released? I’m using the snapshot currently for testing it, but some teams have policies to not allow snapshot versions into their code.

We don’t have a date to share, but it’s probably happening in the near future as we have much to deliver 👍

1reaction
AndrewWestbergcommented, Aug 21, 2020

When will 3.3.0 be released? I’m using the snapshot currently for testing it, but some teams have policies to not allow snapshot versions into their code.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simple Android project crashing by StrictMode ThreadPolicy ...
The crash is due to .penaltyDeath(). If you do not intend to crash the app on violation of strict mode then remove this....
Read more >
StrictMode - Android Developers
A convenience wrapper that takes the current ThreadPolicy from ... Enable the recommended StrictMode defaults, with violations just being logged.
Read more >
Android Studio instrumentation triggers strictmode ...
When running my multi-process app on Android 12 Beta3 emulator it crashes due to Android Studio instrumentation violating StrictMode checks. This happens in...
Read more >
core/java/android/os/StrictMode.java - platform/frameworks/base.git ...
StrictMode.java ... Use StrictMode to find things you did by accident. ... throw new RuntimeException("StrictMode ThreadPolicy violation", violation);.
Read more >
Strict Mode in Android - Tech Blogs
Thread Policy · penaltyDeath() → On detection of violation app will get crash. · penaltyDeathOnNetwork() → on detection of network violation app ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found