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

Crash wen using library on Android 6 #325

Closed
johanw666 opened this issue May 31, 2021 · 8 comments
Closed

Crash wen using library on Android 6 #325

johanw666 opened this issue May 31, 2021 · 8 comments
Assignees

Comments

@johanw666
Copy link

johanw666 commented May 31, 2021

When I use 2.8.0 in a projact that runs on Android 6, the app crashes on startup without even calling the library. When I go back to 2.7.0 there is no crash. No other changes in the code are made, only the version is put back in build.gradle.

I could not find a clear crash in the logfile but I can send it anyway if you think it will be helpful.

@srikanth-lingala
Copy link
Owner

This is interesting. It looks like some change in 2.8.0 breaks on the Android 6. I guess I used some class which probably does not exist on the JDK on Android 6. Let me check. But it will be quite helpful to have any stacktrace.

@johanw666
Copy link
Author

This is the logfile just after the crash. The app that crashes is a modified Signal client, package name org.thoughtcrime.securesms:

The logfile can be found at https://mega.nz/file/sJAQyZKZ#PO-ZoL1dELB4LKDFscpScDaX44PJ9mOk1z0_hGKAlLw

@srikanth-lingala
Copy link
Owner

I don't see anything specific to zip4j in the log file. Honestly though, I did not read through all the lines of the log file as it is quite big. I searched for some keywords and did not find any. I tried looking at the git commit history between 2.7.0 and 2.8.0, and I am not sure which commit might cause this behaviour.

What is also interesting is that there is a build pipeline in CircleCI which builds zip4j against each Android version from Android 23 to 29. And the one with Android 23 (which relates to Marshmallow) seems to build fine. A disclaimer though: I am no Android expert, and this build pipeline was contributed by one of the users of zip4j, so I am not completely sure if the pipeline is still completely relevant.

I have built several snapshot versions of zip4j, with each version going back in the git commit history. Can you please test with each version and let me know which version crashes your app? That way I will be (hopefully) able to figure out the commit that breaks your app. Ignore the text to the right of each commit, that is for my reference. Please check this post if you have trouble getting those snapshot versions.

2.8.1.1-SNAPSHOT -> Revert "Add module-info (#294)"
2.8.1.2-SNAPSHOT -> #315 Use equals when comparing for file names in entry deletion
2.8.1.3-SNAPSHOT -> #315 Fix entry removal logic check
2.8.1.4-SNAPSHOT -> #315 Flip file name directory check
2.8.1.5-SNAPSHOT -> #321 Avoid using StandardCharsets for older Android compatibility
2.8.1.6-SNAPSHOT -> #290 Read in reverse order to determine end of central directory
2.8.1.7-SNAPSHOT -> #313 Check for busy state at Abstract zip task level
2.8.1.8-SNAPSHOT -> #290 Fix failing tests
2.8.1.9-SNAPSHOT -> #308 Add parent file null check when determining path to zip file
2.8.1.10-SNAPSHOT -> #311 Implement available on ZipInputStream
2.8.1.11-SNAPSHOT -> #307 Add new compression levels for deflate compression
2.8.1.12-SNAPSHOT -> #309 Read data descriptor for a directory
2.8.1.13-SNAPSHOT -> #301 Set password also via a setter on ZipInputStream
2.8.1.14-SNAPSHOT -> #287 Close entry on ZipOutputStream if not manually closed when closing entry
2.8.1.15-SNAPSHOT -> #281 Skip adding file with empty names
2.8.1.16-SNAPSHOT -> #287 Set entryClosed flag to true on ZipOutputStream initialisation

Note: Please do not use any of these snapshot versions in your live app. These versions are only test builds and are not intended for production use

@hubercode
Copy link

Just as a note on the side: I was testing the current version (2.8.0) on several Android 6 devices, including emulators. Everything seems to work fine for me - no app crashes detected.

@srikanth-lingala
Copy link
Owner

@michaelhuber88 Thanks for the info. Much appreciated.
@johanw666 Could this be an issue with your app? As mentioned earlier, even the build pipeline with Android 6 seems to be fine with the current release.

@johanw666
Copy link
Author

I got an log from a user that clarifies it somewhat. Perhaps not an 2.8.0 issue but something with mismatched JDK's. The thread s here: johanw666/Signal-Android#30 , when I google that exception I see it happens to more people. However I don't quite understand which changes I made that trigger it so I need to investigate more.

@johanw666
Copy link
Author

johanw666 commented Jun 6, 2021

I seem to have fixed the issue by using an 1.8 JDK instead of the JDK that is included in Android Studio, which let some code point to Java 11 code that is not supported in Android and caused a crash. Waiting for user feedback of one other affected user to finally close this.

@johanw666
Copy link
Author

OK, it seems indeed to have been an Android Studiop JDK version issue. Sorry to have bothered you with it.

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

No branches or pull requests

3 participants