android-strictmode Questions

1

Solved

After enabling StrictMode I noticed this: 2021-05-08 11:09:42.854 14347-14773/com.myapp D/StrictMode: StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acqu...
Weinert asked 8/5, 2021 at 4:28

3

Solved

With StrictMode enabled I just started getting this exception: java.lang.Throwable: Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network usage
Ballance asked 9/12, 2017 at 0:18

1

Sometimes I get this SctrictMode Exception: 2019-01-28 14:18:23.073 4597-4615/my.app.package E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable...
Mosher asked 30/1, 2019 at 11:27

6

Solved

I have created a very simplified version of my issue below. The strict mode is set up with the following policies: StrictMode.setThreadPolicy( StrictMode.ThreadPolicy.Builder() .detectDiskRead...
Meliamelic asked 9/4, 2019 at 2:20

0

I just saw a pretty weird message in the logs of my Android app: W/System: A resource failed to call close. So, i turned on Strict mode's "detectLeakedClosableObjects", but i got a stac...
Av asked 23/3, 2022 at 9:37

4

Solved

I've enabled StrictMode in my app and it's causing a few crashes as expected. How can I find out where in my code I'm violating these policies? This is the stack trace: E/AndroidRuntime(19523): F...
Hyperbaric asked 20/3, 2012 at 3:19

7

Solved

I am getting this message in logcat A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. Where do I look for the l...
Hewett asked 28/8, 2014 at 8:18

0

New to Android development and trying out StrictMode on my app for the first time. I noticed the following and would like to know if this is a problem in my app or a library—it’s not readily clear ...
Idomeneus asked 25/11, 2020 at 19:21

6

Solved

With the release of Gingerbread, I have been experimenting with some of the new API's, one of them being StrictMode. I noticed that one of the warnings is for getSharedPreferences(). This is the ...
Irruption asked 6/12, 2010 at 21:47

1

I'm trying to disable one of Android StrictMode checks - detection of untagged sockets. I have several reasons to do this: Some libraries used in our app e.g. Crashlytics / Picasso e.t.c. are us...
Kristy asked 16/1, 2019 at 8:4

1

Solved

I'm adding StrictMode to my app and it works great until I add a custom ViolationListener. It seems it cannot find the callback I'm providing and detects that as an error, too. Could you give me ...

2

Solved

I've tried adding Crashlytics to my app, which already has StrictMode enabled with detectAll(). The result was Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network u...
Melany asked 7/11, 2018 at 17:54

1

Solved

I am using the StrictMode in order to find non-SDK usages: if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { StrictMode.setVmPolicy(new StrictMode.VmPolicy.Bui...
Lugsail asked 23/8, 2018 at 15:1

1

Solved

I've recently tried to use StrictMode but got a weird violation, so I tried setting up a new 'Empty Activity' project (in Android Studio) and added an Application class as follows (as described in ...
Firebird asked 25/6, 2018 at 10:30

1

Solved

I have a project with dagger setup with following provider method: @Module(...) abstract class AppModule { @Module companion object { ... @Provides @Singleton @JvmStatic fun provideSharedP...

0

I am getting the following exception when using StrictMode with AdMob: java.lang.Throwable: Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network usage at android.o...
Polloch asked 23/12, 2017 at 2:10

4

I'm anxiously awaiting the open source release of StrictMode for continuation of our platform development. The sample in the Android blog entry suggests surrounding the StrictMode calls with if (...
Loaning asked 15/12, 2010 at 15:0

1

Solved

I faced with the next problem: StrictMode policy violation; ~duration=2235 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65567 violation=2 at android.os.StrictMode$AndroidBlockGua...
Argos asked 2/6, 2017 at 14:52

3

Solved

I'm noticing that StrictMode is complaining quite loudly about WebView creation. Is there any way to improve the startup performance of a WebView object? I'm instantiating from XML in my onCreate()...
Athanasius asked 26/10, 2011 at 3:45

1

I am trying to add some adds in my application. When I have StrictMode enabled, I get a bunch of policy violations like this one (maybe 6 or 7 of these). Is this normal? 18817-18817/com.xyz.xyz.x...
Alexisaley asked 13/8, 2016 at 8:19

0

When I turn on StrictMode at my Application onCreate(), everything was good, and the issue found fixed. However, I realize there's a bug of StrictMode as per this issue. So I made the workaround (...
Euphonious asked 20/7, 2016 at 5:49

0

Hiii, I have added crashlytics for error reporting and when I enable strict mode, I am getting resource leaks. Any idea where I am wrong, A resource was acquired at attached stack trace but never ...
Chintz asked 12/10, 2015 at 6:36

1

Solved

I know that StrictMode designed mainly to be used in application development phase, but according to my app needs, it's not acceptable to get ANR while it's quite acceptable to get crash, and Stric...
Jamie asked 1/4, 2015 at 14:7

6

Solved

I am running my app with StrictMode activated in development as documented here StrictMode for lower platform versions and noticed an error message that I do not know what to think about nor can I ...
Camp asked 10/5, 2011 at 20:34

1

Solved

Code is probably too complex to post here in full, but here is the basic schema: I have two Activity subclasses, each of which hosts a ListView. Each ListView has an adapter of a custom class, whic...
Overcareful asked 12/3, 2013 at 17:36

© 2022 - 2024 — McMap. All rights reserved.