With a lack of memory, an error occurs here
private Interceptor provideOfflineCacheInterceptor() { return new Interceptor() { @Override public Response intercept(@NonNull Chain chain) throws IOException { Request request = chain.request(); if (!isConnect()) { CacheControl cacheControl = new CacheControl.Builder() .maxStale(DISC_CACHE_LENGTH_DAYS, TimeUnit.DAYS) .build(); request = request.newBuilder() .cacheControl(cacheControl) .build(); } return chain.proceed(request); } }; } specifically swears at the line
return chain.proceed(request); here is the stack trace
But it is not released. See java.io.Closeable for information on avoiding resource leaks. java.lang.Throwable: Explicit termination method is not called at dalvik.system.CloseGuard.open (CloseGuard.java:223) at java.io.FileOutputStream. (FileOutputStream.java:224) at okio.Okio.appendingSink ( Okio.java:186) at okhttp3.internal.io.FileSystem $ 1.appendingSink (FileSystem.java:59) at okhttp3.internal.cache.DiskLruCache.newJournalWriter (DiskLruCache.java.7015) at okhttp3.internal.cache.DiskLruCache. readJournal (DiskLruCache.java:307) at okhttp3.internal.cache.DiskLruCache.initialize (DiskLruCache.java:228) at okhttp3.internal.cache.DiskLruCache.get (DiskLruCache.java penet36) at okhttp3.Cache.get (Cache .java: 195) at okhttp3.Cache $ 1.get (Cache.java:145)
With enough memory, everything is working fine. How to fix the problem mono?