When I run my Android App I get the following error:
10-12 16:46:44.719 2710-2719/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
10-12 16:46:44.719 2710-2719/? E/StrictMode: java.lang.Throwable: Explicit termination method 'end' not called
10-12 16:46:44.719 2710-2719/? E/StrictMode: at dalvik.system.CloseGuard.open(CloseGuard.java:184)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at java.util.zip.Inflater.<init>(Inflater.java:82)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.android.okio.GzipSource.<init>(GzipSource.java:57)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.android.okhttp.internal.http.HttpEngine.initContentStream(HttpEngine.java:490)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:680)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:388)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.http.GoogleHttpClient.a(SourceFile:806)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.http.GoogleHttpClient.b(SourceFile:770)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:673)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.http.GoogleHttpClient.execute(SourceFile:664)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.playlog.uploader.b.a(SourceFile:332)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.playlog.uploader.b.a(SourceFile:227)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.playlog.uploader.b.a(SourceFile:199)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.playlog.uploader.UploaderService.a(SourceFile:39)
10-12 16:46:44.719 2710-2719/? E/StrictMode: at com.google.android.gms.gcm.af.run(SourceFile:130)
What does this error mean and how can I resolve it?
Could you share your code? Did you use the emulator to run your app or a phisical device?
Because there may be many reasons:
You have opened something but never close them. Closable
has a close()
method which you must call to manually release the opened resources associated with the component when you no longer need it (for example in a finally
block).
Also, that error message shows up when there is a problem in AndroidManifest.xml
. For example when the <activity>
tag accidentally went out of <application>
Emulators have StrictMode
on by default, on real devices it can be turned on in code via:
Code:
StrictMode.setVmPolicy (new StrictMode.VmPolicy.Builder().detectAll().penaltyLog()
.penaltyDeath().build());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With