StrictMode(30621): A resource was acquired at attached stack trace but never released
See original GitHub issueEnvironment:
- Android Studio version: 4.0.1
- Firebase Component: com.google.firebase:firebase-auth-ktx
- Component version: 20.0.3
- compileSdkVersion: 29
Description:
It’s not easy to reproduce. Some have observed it to happen more often when disconnecting from the network.
StrictMode keeps terminating the app with this stacktrace:
04-12 10:06:14.591 E/StrictMode(30621): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
04-12 10:06:14.591 E/StrictMode(30621): java.lang.Throwable: Explicit termination method 'close' not called
04-12 10:06:14.591 E/StrictMode(30621): at dalvik.system.CloseGuard.open(CloseGuard.java:180)
04-12 10:06:14.591 E/StrictMode(30621): at java.net.AbstractPlainSocketImpl.create(AbstractPlainSocketImpl.java:103)
04-12 10:06:14.591 E/StrictMode(30621): at java.net.Socket.createImpl(Socket.java:470)
04-12 10:06:14.591 E/StrictMode(30621): at java.net.Socket.getImpl(Socket.java:536)
04-12 10:06:14.591 E/StrictMode(30621): at java.net.Socket.setSoTimeout(Socket.java:1134)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.Connection.connectSocket(Connection.java:195)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.Connection.connect(Connection.java:172)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.Connection.connectAndSetOwner(Connection.java:367)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:130)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:330)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:247)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:457)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:126)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:257)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
04-12 10:06:14.591 E/StrictMode(30621): at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.internal.firebase-auth-api.zzvg.zza(com.google.firebase:firebase-auth@@20.0.3:10)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.internal.firebase-auth-api.zzuq.zzb(com.google.firebase:firebase-auth@@20.0.3:4)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.internal.firebase-auth-api.zzpy.zza(com.google.firebase:firebase-auth@@20.0.3:4)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.internal.firebase-auth-api.zztu.zzb(com.google.firebase:firebase-auth@@20.0.3:5)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.internal.firebase-auth-api.zzqw.zzd(com.google.firebase:firebase-auth@@20.0.3:3)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.internal.firebase-auth-api.zzqv.accept(com.google.firebase:firebase-auth@@20.0.3)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.api.internal.zacj.doExecute(com.google.android.gms:play-services-base@@17.1.0:2)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.api.internal.zaf.zac(com.google.android.gms:play-services-base@@17.1.0:6)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zac(com.google.android.gms:play-services-base@@17.1.0:167)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zab(com.google.android.gms:play-services-base@@17.1.0:139)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zabg(com.google.android.gms:play-services-base@@17.1.0:99)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zabe(com.google.android.gms:play-services-base@@17.1.0:40)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.onConnected(com.google.android.gms:play-services-base@@17.1.0:19)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.internal.zaf.onConnected(com.google.android.gms:play-services-base@@17.1.0:2)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.internal.BaseGmsClient$zzg.zzj(com.google.android.gms:play-services-basement@@17.1.0:24)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.internal.BaseGmsClient$zza.zza(com.google.android.gms:play-services-basement@@17.1.0:12)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.internal.BaseGmsClient$zzb.zzo(com.google.android.gms:play-services-basement@@17.1.0:11)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.common.internal.BaseGmsClient$zzc.handleMessage(com.google.android.gms:play-services-basement@@17.1.0:49)
04-12 10:06:14.591 E/StrictMode(30621): at android.os.Handler.dispatchMessage(Handler.java:102)
04-12 10:06:14.591 E/StrictMode(30621): at com.google.android.gms.internal.common.zzi.dispatchMessage(com.google.android.gms:play-services-basement@@17.1.0:8)
04-12 10:06:14.591 E/StrictMode(30621): at android.os.Looper.loop(Looper.java:154)
04-12 10:06:14.591 E/StrictMode(30621): at android.os.HandlerThread.run(HandlerThread.java:61)
04-12 10:06:14.591 W/System.err(30621): StrictMode VmPolicy violation with POLICY_DEATH; shutting down.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
A resource was acquired at attached stack trace but never ...
That means you have opened something but never close them. Closable have a method close which you must call to release the resources...
Read more >A resource was acquired at attached stack trace but ... - GitHub
A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
Read more >Strict Mode “A resource was acquired at attached stack trace ...
Bug: Strict Mode “A resource was acquired at attached stack trace but never released” exception with Google Map.
Read more >Android Strict Mode complaining HttpURLConnection is never ...
E/StrictMode( 1096): A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. E/ ...
Read more >Java – Android: A resource was acquired at attached stack ...
That means you have opened something but never close them. Closable have a method close which you must call to release the resources...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is almost certainly a missing #close() statement in the Auth SDK. I’ve filed b/185793197 for internal tracking
thank you for filing an internal bug 👍