Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LeakedClosableViolation in StrictMode #182

Open
EGecius opened this issue Aug 14, 2019 · 1 comment
Open

LeakedClosableViolation in StrictMode #182

EGecius opened this issue Aug 14, 2019 · 1 comment

Comments

@EGecius
Copy link

EGecius commented Aug 14, 2019

If I add this library, I have to remove a check for LeakedClosableViolation, which weakens my overall ongoing checks of the codebase.

I understand that removing all StrictMode violations in this library is non-trivial. How about this one?

2019-08-14 11:50:24.383 19269-19278/uk.co.paymentsense.customerportal.beta 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:1786) at dalvik.system.CloseGuard.warnIfOpen(CloseGuard.java:264) at android.os.ParcelFileDescriptor.finalize(ParcelFileDescriptor.java:988) at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:250) at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:237) at java.lang.Daemons$Daemon.run(Daemons.java:103) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.Throwable: Explicit termination method 'close' not called at dalvik.system.CloseGuard.open(CloseGuard.java:221) at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:192) at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:181) at android.content.res.AssetManager.nativeOpenAssetFd(Native Method) at android.content.res.AssetManager.openFd(AssetManager.java:768) at com.willowtreeapps.hyperion.geigercounter.DroppedFrameDetector.<init>(DroppedFrameDetector.java:60) at com.willowtreeapps.hyperion.geigercounter.GeigerCounterPlugin.onApplicationCreated(GeigerCounterPlugin.java:31) at com.willowtreeapps.hyperion.plugin.v1.Plugin.create(Plugin.java:16) at com.willowtreeapps.hyperion.core.internal.ApplicationInstaller.installIfNeeded(ApplicationInstaller.java:32) at com.willowtreeapps.hyperion.core.internal.InstallationLifecycleDelegate.onActivityCreated(InstallationLifecycleDelegate.java:30) at com.willowtreeapps.hyperion.core.internal.Lifecycle.onActivityCreated(Lifecycle.java:24) at com.willowtreeapps.hyperion.core.internal.HyperionIgnoreFilter.onActivityCreated(HyperionIgnoreFilter.java:26) at android.app.Application.dispatchActivityCreated(Application.java:220) at android.app.Activity.onCreate(Activity.java:1048) at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:149) at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:313) at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:106)

@ToxicBakery
Copy link
Contributor

while not a fix, if you create a hyperion build variant, you can set lint rules for that specific variant or alternately disable the strict mode settings for that variant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants