diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java index 9739f21923..599474d6c3 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/cache/SimpleCache.java @@ -16,6 +16,7 @@ package com.google.android.exoplayer2.upstream.cache; import android.os.ConditionVariable; +import android.util.Log; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.util.Assertions; import java.io.File; @@ -31,6 +32,8 @@ import java.util.TreeSet; */ public final class SimpleCache implements Cache { + private static final String TAG = "SimpleCache"; + private final File cacheDir; private final CacheEvictor evictor; private final HashMap lockedSpans; @@ -288,7 +291,11 @@ public final class SimpleCache implements Cache { } index.removeEmpty(); - // Don't call index.store() here so initialization doesn't fail because of write issues. + try { + index.store(); + } catch (CacheException e) { + Log.e(TAG, "Storing index file failed", e); + } } /**