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:
- Created 3 years ago
- Reactions:1
- Comments:12 (6 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We don’t have a date to share, but it’s probably happening in the near future as we have much to deliver 👍
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.