New to Android development and trying out StrictMode on my app for the first time. I noticed the following and would like to know if this is a problem in my app or a library—it’s not readily clear to me.
Thank you!
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. Callsite: readFromParcel
at android.os.StrictMode$AndroidCloseGuardReporter.report(StrictMode.java:1929)
at dalvik.system.CloseGuard.warnIfOpen(CloseGuard.java:305)
at android.view.SurfaceControl.finalize(SurfaceControl.java:1104)
at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:291)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:278)
at java.lang.Daemons$Daemon.run(Daemons.java:139)
at java.lang.Thread.run(Thread.java:923)
onCreateView
is called. It also started happening later randomly once I added code to download files from a server withHttpURLConnection
,InputStream
andFileOutputStream
(yes, I'm closing all of them). MyStrictMode
log looks exactly like yours, sometimes it also says "Callsite: close". Were/are you possibly using anAsyncTask
? I'm only using that, no threads or anything else and never callThread.start
myself. – Gader