136 questions
0
votes
0
answers
98
views
Enabling "detectUnsafeIntentLaunch" in strictMode throws warning even for Implicit Intent with setPackage
I have enabled detectUnsafeIntentLaunch in strict mode to test for change while targeting for android SDK 35 in my SDK.
I have the following code where I send a broadcast and it is caught within the ...
0
votes
0
answers
113
views
StrictMode DiskReadViolation at auen.a(:com.google.android.gms@233717044)
Description: I am only using com.google.android.gms packaged classes for AD Id and Remote config and all the code is being run on IO Dispatcher. I feel this is happening internally on Google's side. ...
1
vote
0
answers
70
views
Suppressing known errors in android strict mode
I am trying to implement strict mode in android and my use case is I want to suppress the known errors which cant be fixed and let the app to crash on new scenarios. Is there anything like lint-...
1
vote
0
answers
383
views
How to fix StrictMode policy violation; ~duration=17 ms: android.os.strictmode.DiskReadViolation on call to startActivity(intent)
We have enabled strict mode in one of our activities to check for violations, getting a trace pointing to the startActivity() call belonging to the Activity class. I'm not sure why it's throwing this ...
1
vote
2
answers
262
views
How to check the connection status in Android avoiding StrictMode
I created a function that returns a boolean based on the presence of an internet connection, this function it is called different times from different java classes.
The only way that I find to use it ...
1
vote
2
answers
1k
views
How to Fix Duplicated Paypal Button in React Strict Mode
Hi guys would like to know how to fix this issue after updating to React 18 I have a duplicated
button due to the useEffect while in StrictMode. Any guide how to unsubscribe to this API call
or maybe ...
2
votes
1
answer
994
views
"findDOMNode is deprecated in StrictMode" using react-datepicker with React-Hook-Form
I'm having an issue when trying to use "showMonthDropdown" or "showYearDropdown" options with react-datepicker.
Everything is working great until I click on the years or month ...
6
votes
0
answers
561
views
Can i get more info out of this strict mode LeakedClosableViolation message?
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 stack ...
1
vote
2
answers
357
views
Is there a way to ahead detect ANR programmatically in production?
StrictMode is designed to be used in development and is disabled by default without developer mode, so I'm wondering if there is a way to detect ANR condition ahead, in order to intervene properly ...
0
votes
0
answers
345
views
StrictMode policy violation Android in Gson
I am getting the following in my application:
StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe;
at android.os.StrictMode....
0
votes
1
answer
190
views
How can I find where the nonSdk violation is occuring in my source code?
I created an app that works perfectly fine on my phone but not well on an MI phone. The reason must be using non-SDK APIs.
I have a Pre-launch report which tells me I am using non-SDK API's but I am ...
2
votes
1
answer
767
views
Is Google Play activating StrictMode for prelaunch tests?
I have submitted an app to Google Play and the Play Console prelaunch tests show a number of API policy violations (use of restricted / unsupported APIs):
When I check the stack traces for these ...
24
votes
1
answer
1k
views
How to debug leak caused by UnixDirectoryStream in Android app
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 ...
2
votes
0
answers
196
views
Нow to enable and see StrictMode on android in cordova
I modify via hook CordovaActivity.java. I insert the inclusion of a striсt mode there and then in the onTouchEvent I do an endless loop:
package org.apache.cordova;
. . .
import android.os....
30
votes
0
answers
5k
views
StrictMode policy violation: android.os.strictmode.LeakedClosableViolation in my app?
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 to ...
4
votes
2
answers
1k
views
Powershell object cannot be found with strictmode latest
I am trying to get below to work under set-strictmode -version latest, it works completely fine without strict mode, unfortunately it's a requirement to have latest strictmode in my environment.
What ...
4
votes
0
answers
222
views
addPreferencesFromResource() causing StrictMode violation on Android
I have few fragments extending PreferenceFragmentCompat class from "preference-v8-28.0.0". In order to inflate the view i use addPreferencesFromResource(..) as follows:
@Override
public ...
0
votes
1
answer
971
views
App is crashing Caused by: java.lang.IllegalStateException: No successful match so far
My app is running perfectly at debug mode but is crashing at release mode, so when i set debuggable to be true i realized that the error is from switch case and one method.
Caused by: java.lang....
1
vote
1
answer
2k
views
Android StrictMode Policy: A resource was acquired at attached stack trace but never released Error
I am using Image Compression method from this link it working fine if i compress single image but as soon as i give this method multiple images to compress in STRICT MODE app get crashed at ...
1
vote
1
answer
2k
views
Android StrictMode java.lang.Throwable: Explicit termination method 'close' not called
i enable strict mode in my app and it crashed with an error
boolean DEVELOPER_MODE=true;
if (DEVELOPER_MODE) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
...
1
vote
0
answers
774
views
KeyguardManager.isKeyguardSecure cause StrictMode policy violation
I want to check whether the device screen lock is enabled or not and I am using the standard API provided by Android SDK as shown below. But I am receiving
D/StrictMode: StrictMode policy violation; ...
0
votes
2
answers
283
views
How to fix "System services not available to Activities before onCreate" when passing values between classes, and updating recycler view?
I'm making an order taking cashier application. Using a recycler view to show the order queue. However, I'm having trouble passing ArrayList values between classes, and also, updating the recycler ...
4
votes
1
answer
4k
views
Simple Android project crashing by StrictMode ThreadPolicy violation, strictmode.DiskReadViolation
I have created new Android project, an empty activity project and used StrictMode but the application crashes every time due to strictmode.DiskReadViolation
I fallow the answer of my similar ...
0
votes
1
answer
1k
views
I am getting warnings in my android program after I updated my project to android x library in android studio
Below are the warnings I am getting.
1) Android compatibility - Google play store has marked API '
Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols()'
grey listed and they cant ...
2
votes
2
answers
2k
views
A WebView method was called on thread 'FinalizerDaemon' BUT MY APP HAS NO WEBVIEW
I'm using StrictMode policy while developing my app:
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
.detectLeakedSqlLiteObjects()
....
0
votes
1
answer
699
views
Android app extremely slow to swipe viewpager and scroll through recyclerview, how to pintpoint cause?
So, I've been stuck on this issue for a week where I launch my app and it freezes for almost 10 seconds on a white screen and after that the app gets really slow. I have a bottomnavigationview with a ...
10
votes
6
answers
3k
views
Android Kotlin coroutine crashing on strict mode
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()
...
7
votes
1
answer
2k
views
Android's StrictMode penaltyListener gives NoClassDefFoundError
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 a ...
7
votes
1
answer
1k
views
StrictMode: A resource was acquired at attached stack trace but never released
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 ...
14
votes
1
answer
4k
views
StrictMode: How to disable "Untagged socket detected" in Android for targetSdk >= 28
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 using ...
3
votes
1
answer
858
views
kotlin coroutines disk violation strict mode
I have lifecycle aware coroutine
abstract class AppViewModel : ViewModel(), CoroutineScope {
private val job = Job()
override val coroutineContext: CoroutineContext
get() = ...
1
vote
0
answers
68
views
StrictMode shows 10 errors for one line of code
I am running StrictMode.enableDefaults() to clean up my code and I have one line of code that sets the ZoneId that gives 10 StrictMode violations at about 195ms each for the single line of code. The ...
6
votes
2
answers
3k
views
Crashlytics with StrictMode enabled (detect all) gives "untagged socket detected"
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 ...
0
votes
1
answer
287
views
Why is StrictMode logging not being output on a Marshmallow device?
The code, called from Application.onCreate():
private fun enableOnStrictMode() {
StrictMode.setThreadPolicy(
StrictMode
.ThreadPolicy
.Builder()...
37
votes
1
answer
30k
views
Android P (API 28) - What does the StrictMode policy violation "SmartSelectionEventTracker$SelectionEvent;->selectionAction" mean?
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....
2
votes
0
answers
3k
views
Python(Server) Android(Client) Socket Programming
I'd like to make a program which connects Python code with Android Studio.
But there has been a problem on android studio which is not showing any UI that I'd like to show on Emulator Screen. I think ...
8
votes
1
answer
3k
views
StrictMode disk read violation on empty activity's setContentView
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 ...
5
votes
2
answers
2k
views
When start strict mode and set `android:persistent` to `true` will has error. How can I fix this error?
When start strict mode and set android:persistent to true will has error. How can I fix this error? Thanks.
Application
override fun onCreate() {
if (BuildConfig.DEBUG) {
setStrictMode()
...
2
votes
0
answers
3k
views
StrictMode policy violation (DiskReadViolation) overestimates result against measureTimeMillis{} block
I have enabled StrictMode, and got a warning.
StrictMode policy violation; ~duration=509 ms: android.os.strictmode.DiskReadViolation
at android.os.StrictMode$AndroidBlockGuardPolicy....
1
vote
3
answers
6k
views
Is it possible to avoid ANR using StrictMode in android?
Somewhere I read that By using StrictMode we can avoid ANR in android. I tried like that below is the code
public class MyApplication extends Application {
@Override
public void onCreate() {
...
10
votes
1
answer
8k
views
StrictMode: StrictModeDiskReadViolation when creating SharedPreference
I have a project with dagger setup with following provider method:
@Module(...)
abstract class AppModule {
@Module
companion object {
...
@Provides
@Singleton
@JvmStatic
fun ...
0
votes
0
answers
329
views
Android StrictMode issue with Huawei Mate 9 Nougat
I've got an Android Instrumented test where I try to start my application and perform the following operations:
open class MyApplication : Application() {
...
override fun onCreate() {
super....
8
votes
0
answers
3k
views
StrictMode java.lang.Throwable: Untagged socket detected with AdMob
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....
28
votes
3
answers
23k
views
StrictMode java.lang.Throwable: Untagged socket detected
With StrictMode enabled I just started getting this exception:
java.lang.Throwable: Untagged socket detected; use TrafficStats.setThreadSocketTag() to track all network usage
1
vote
0
answers
114
views
A resource was acquired at attached stack trace but never released in DynamiteModulesC
I am using Strict mode and am getting a lot of this errors.
E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding ...
6
votes
1
answer
5k
views
StrictMode AndroidBlockGuardPolicy.onReadFromDisk
I faced with the next problem:
StrictMode policy violation; ~duration=2235 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=65567 violation=2
...
0
votes
0
answers
376
views
Android Studio Strict Mode Unable to Locate Error
I am using the strict mode in android studio but i am unable to locate the code that's causing the error.The error is caused due to an unclosed object but i have checked all my activities and no such ...
0
votes
1
answer
395
views
Resource Leak issue in android [closed]
My android application is crashing with strictmode violation message with any specific information that what is causing the issue. Crash starting appearing when I configured FCM with my application ...
4
votes
1
answer
3k
views
StrictMode policy violation: StrictModeDiskReadViolation,WriteViolation in Android
I am working an Android project that uses Google maps. The app is working perfectly in my Cell phone, having 5.1.1 Android version, because I used it for the development of the project, but the same ...
4
votes
1
answer
5k
views
Cant see StrictMode details on logcat - Suppressed StrictMode policy violation on screen rotation
My problem is this, I'm trying to understand the source of this trace:
11-06 22:07:36.593 2744-3492/com.spot.spottester W/f: Suppressed StrictMode policy violation: StrictModeDiskReadViolation
11-06 ...