StrictMode policy violation: StrictModeDiskReadViolation,WriteViolation in Android

2.8k views Asked by At

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 app is not working in other cell phone (6.0.0 Android). In other cell phone Google Map is not updating. (Not going to current location). Why the Google Map is not updating in other cell phone?

Prompting this;

12-13 08:25:55.796 11170-11170/com.example.mapspractice1 W/f: Suppressed StrictMode policy violation: StrictModeDiskReadViolation

12-13 08:25:55.796 11170-11170/com.example.mapspractice1 W/f: Suppressed StrictMode policy violation: StrictModeDiskWriteViolation

12-13 08:25:55.939 11170-11458/com.example.mapspractice1 W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.

12-13 08:25:55.949 11170-11458/com.example.mapspractice1 I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:2

12-13 08:25:55.949 11170-11458/com.example.mapspractice1 I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 2

12-13 08:25:59.044 11170-11209/com.example.mapspractice1 V/FA: Inactivity, disconnecting from the service
1

There are 1 answers

2
marmor On BEST ANSWER

I don't think the log warnings you see are relevant to the problem, they're just warnings, and I believe you can safely ignore them.

What might be related to not being able to get current location in Android M (6) is the new Runtime Permissions model. If you've set your android:targetSdkVersion to 23 or higher you need to explicitly ask for each permission you need from the user, in addition to putting it on AndroidManifest.

To check this, on an Android M device,

open the phone's Settings app > apps > find and select your app > permissions > enable "Location" permission.

It should now recognize the location in the app properly.

See this: https://developer.android.com/training/permissions/requesting.html on how to request permissions from your users in runtime.