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

Explicit termination method 'end' not called on Android #127

Closed
everwanna opened this issue Jan 12, 2020 · 5 comments
Closed

Explicit termination method 'end' not called on Android #127

everwanna opened this issue Jan 12, 2020 · 5 comments
Assignees
Labels
bug Something isn't working resolved

Comments

@everwanna
Copy link

Similar to #3 and #17

It looks like inflater.end() not called in InflaterInputStream.

2020-01-11 21:48:13.555 23005-23020/tech.bluespace.android.id_guard_test 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 net.lingala.zip4j.io.inputstream.InflaterInputStream.<init>(InflaterInputStream.java:20)
        at net.lingala.zip4j.io.inputstream.ZipInputStream.initializeDecompressorForThisEntry(ZipInputStream.java:220)
        at net.lingala.zip4j.io.inputstream.ZipInputStream.initializeEntryInputStream(ZipInputStream.java:201)
        at net.lingala.zip4j.io.inputstream.ZipInputStream.getNextEntry(ZipInputStream.java:106)
        at net.lingala.zip4j.tasks.AbstractExtractFileTask.verifyNextEntry(AbstractExtractFileTask.java:81)
        at net.lingala.zip4j.tasks.AbstractExtractFileTask.extractFile(AbstractExtractFileTask.java:47)
        at net.lingala.zip4j.tasks.ExtractAllFilesTask.executeTask(ExtractAllFilesTask.java:35)
        at net.lingala.zip4j.tasks.ExtractAllFilesTask.executeTask(ExtractAllFilesTask.java:13)
        at net.lingala.zip4j.tasks.AsyncZipTask.performTaskWithErrorHandling(AsyncZipTask.java:42)
        at net.lingala.zip4j.tasks.AsyncZipTask.execute(AsyncZipTask.java:36)
        at net.lingala.zip4j.ZipFile.extractAll(ZipFile.java:437)
@srikanth-lingala
Copy link
Owner

Can you share your code and the circumstance in which the application was terminated? Was the application abruptly terminated or did the application run was complete, in other words, was the application force terminated or did zip4j complete its task before the application stopped?

@srikanth-lingala
Copy link
Owner

I think I found the issue. I made a fix for it. Fix is not in master but in the inflater-end branch. I just did a SNAPSHOT release with version 2.3.1-SNAPSHOT with the fix. Can you please use this version and see if this fixes the issue? You have to follow the instruction mentioned here to get this snapshot version in your maven.

@everwanna
Copy link
Author

Good, the error is gone with version 2.3.1-SNAPSHOT. Thanks man!

@srikanth-lingala
Copy link
Owner

Thanks for the confirmation. I will include the fix in the next release.

@srikanth-lingala
Copy link
Owner

Fixed in v2.3.1 released today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

2 participants