4

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 22:07:36.594 2744-2744/com.spot.spottester W/f: Suppressed StrictMode policy violation: StrictModeDiskReadViolation

I got these StrictMode lines appearing on my Android Studio logcat every time I rotate screen from portrait to landscape and viceversa. I dont understand why logcat indicates "Suppressed" because I think StrictMode is activated in my main Activity (the only one)

@Override
protected void onCreate(Bundle savedInstanceState) {

    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
            .detectAll()
            .penaltyLog()
            .build());

Additional information: I see this strict mode violations when Im working with maps, map fragment on FrameLayout

<FrameLayout
    android:id="@+id/mapContainer"
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:layout_gravity="center_horizontal"
    android:layout_weight="0.35">

    <fragment
        android:id="@+id/mapFragment"
        class="com.google.android.gms.maps.MapFragment"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
</FrameLayout>

Additional lines of logcat

11-07 08:47:39.495 32751-4156/com.spot.spottester I/dalvikvm-heap: Grow heap (frag case) to 15.568MB for 196624-byte allocation

11-07 08:47:40.217 32751-32751/com.spot.spottester I/Google Maps Android API: Google Play services package version: 9877036

Thanks you all!

MashukKhan
  • 1,946
  • 1
  • 27
  • 46
AER
  • 95
  • 2
  • 7

1 Answers1

4

UPDATE: Now fixed as of Google Play Services 10.2.0:

Good news! The issue where you were seeing "Suppressed StrictMode policy violation: StrictModeDiskReadViolation" logs is now fixed in Google Play Services 10.2. The fix in the the Google Play Services APK which is installed on your users devices.

https://code.google.com/p/gmaps-api-issues/issues/detail?id=11077


ORIGINAL: I have been seeing these "Suppressed StrictMode policy violation" messages in logcat too - using Google Maps fragment. Even though I am not using StrictMode in my app, the suppression messages still appear.

I think it might be related to this issue fix from Google in October, as I have only noticed it recently:

This issue is now fixed in the Google Play Services 9.8 release. You should no longer see StrictMode violations from the Android Maps API in the logs, and you should therefore be able to re-enable StrictMode in your Activity.

https://code.google.com/p/gmaps-api-issues/issues/detail?id=10170

My thinking is they 'fixed' the big stack trace outputs by writing them as a single 'suppressed' line instead... but they've put it in for non-strict mode apps too.

cometfish
  • 523
  • 2
  • 6
  • 15
  • 1
    Thank you cometfish, I am using 9.8 release and still seeing Suppressed StrictMode log line, very strange. – AER Nov 09 '16 at 13:49
  • I'm facing the same problem. Does anyone know how to at least ignore these messages in logcat? – user3448282 Dec 07 '16 at 07:58
  • 1
    Still get this in 10.0.x too – JPM Dec 27 '16 at 20:08
  • so is this just always going to appear? Virtually every time someone non-android looks at my log they come over and I have to explain that this isn't something to do with me... very tedious – Saik Caskey Feb 02 '17 at 14:22
  • Looks like this is fixed as of google play services v10.2.0... I'll update my answer. – cometfish Mar 07 '17 at 04:35