question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remote Config failing to pass StrictMode

See original GitHub issue

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio 3.5
  • Firebase Component: Remote Config
  • Component version: 19.0.0/19.0.1

[REQUIRED] Step 3: Describe the problem

Remote Config 19.0.0 and 19.0.1 are failing to pass StrictMode because of the following reason:

Explicit termination method ‘end’ not called

Here’s the full log:

Version 19.0.0:

D/StrictMode: StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
        at android.os.StrictMode$AndroidCloseGuardReporter.report(StrictMode.java:1877)
        at dalvik.system.CloseGuard.warnIfOpen(CloseGuard.java:286)
        at java.util.zip.Inflater.finalize(Inflater.java:407)
        at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:289)
        at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:276)
        at java.lang.Daemons$Daemon.run(Daemons.java:137)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.Throwable: Explicit termination method 'end' not called
        at dalvik.system.CloseGuard.open(CloseGuard.java:237)
        at java.util.zip.Inflater.<init>(Inflater.java:122)
        at com.android.okhttp.okio.GzipSource.<init>(GzipSource.java:64)
        at com.android.okhttp.internal.http.HttpEngine.unzip(HttpEngine.java:484)
        at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:661)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:475)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHttpClient.fetch(com.google.firebase:firebase-config@@19.0.0:186)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler.fetchFromBackend(com.google.firebase:firebase-config@@19.0.0:278)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler.fetchFromBackendAndCacheResponse(com.google.firebase:firebase-config@@19.0.0:251)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler.fetchIfCacheExpiredAndNotThrottled(com.google.firebase:firebase-config@@19.0.0:191)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler.lambda$fetch$0(com.google.firebase:firebase-config@@19.0.0:160)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler$$Lambda$1.then(Unknown Source:4)
        at com.google.android.gms.tasks.zzf.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

Version 19.0.1:

D/StrictMode: StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
        at android.os.StrictMode$AndroidCloseGuardReporter.report(StrictMode.java:1877)
        at dalvik.system.CloseGuard.warnIfOpen(CloseGuard.java:286)
        at java.util.zip.Inflater.finalize(Inflater.java:407)
        at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:289)
        at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:276)
        at java.lang.Daemons$Daemon.run(Daemons.java:137)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: java.lang.Throwable: Explicit termination method 'end' not called
        at dalvik.system.CloseGuard.open(CloseGuard.java:237)
        at java.util.zip.Inflater.<init>(Inflater.java:122)
        at com.android.okhttp.okio.GzipSource.<init>(GzipSource.java:64)
        at com.android.okhttp.internal.http.HttpEngine.unzip(HttpEngine.java:484)
        at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:661)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:475)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
        at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
        at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
        at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHttpClient.fetch(com.google.firebase:firebase-config@@19.0.1:186)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler.fetchFromBackend(com.google.firebase:firebase-config@@19.0.1:278)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler.fetchFromBackendAndCacheResponse(com.google.firebase:firebase-config@@19.0.1:251)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler.fetchIfCacheExpiredAndNotThrottled(com.google.firebase:firebase-config@@19.0.1:191)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler.lambda$fetch$0(com.google.firebase:firebase-config@@19.0.1:160)
        at com.google.firebase.remoteconfig.internal.ConfigFetchHandler$$Lambda$1.then(Unknown Source:4)
        at com.google.android.gms.tasks.zzf.run(Unknown Source:2)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)

Of course, disabling StrictMode would disable the logs, but the issue would still be there.

Steps to reproduce:

Use Remote Config 19.0.0 or 19.0.1 as you would normally do, and enable StrictMode for the application. Run it, and after a few seconds, the application will log what I shared right above.

Relevant Code:

Add the following code within the onCreate method of your class extending android.app.Application.

StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
    .detectLeakedClosableObjects()
    .penaltyLog()
    .build());

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
evowizzcommented, Oct 17, 2019

Hello there,

The version 19.0.3 fixes this issue. Thanks again @clp93!

2reactions
clp93commented, Sep 23, 2019

Hey all, thanks for the report. https://github.com/firebase/firebase-android-sdk/pull/808 should resolve the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase Remote Config loading strategies - Google
Firebase Remote Config loading strategies · Strategy 1: Fetch and activate on load · Strategy 2: Activate behind loading screen · Strategy 3:...
Read more >
Invoke-Command (Microsoft.PowerShell.Core) - Microsoft Learn
The Invoke-Command cmdlet runs commands on a local or remote computer and returns all output from the commands, including errors.
Read more >
Frequently Asked Questions - Snakemake - Read the Docs
My shell command fails with exit code != 0 from within a pipe, what's wrong?¶. Snakemake is using bash strict mode to ensure...
Read more >
Configuration - MkDocs
Project settings are configured by default using a YAML configuration file in ... http://127.0.0.1:8000/foo/some/page/ to mimic the expected remote layout.
Read more >
next.config.js: Rewrites
You can still pass the parameters manually in the query if one is already used in the destination by specifying the query in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found