Skip to content

Error Occured / Clone failed / Inflater has been closed #714

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

Open
johann-petrak opened this issue May 24, 2024 · 12 comments
Open

Error Occured / Clone failed / Inflater has been closed #714

johann-petrak opened this issue May 24, 2024 · 12 comments
Assignees

Comments

@johann-petrak
Copy link

johann-petrak commented May 24, 2024

Cloning a (private) git repo that has site of about 360M (including the .git directory).

The progress indicator shows that the download and some other processing works, but then I get an error popup showing the message:

Error occurred
Clone failed
Inflater has been closed
  • Device: Galaxy Tab S9 Ultra
  • OS: Android version 14
  • App Version: 1.7.0

Not sure if this still is what has been reported in #54

@Archkik
Copy link

Archkik commented Nov 25, 2024

same here

@Manguil
Copy link

Manguil commented Dec 29, 2024

same error for a large git repository

@Zacharia2
Copy link

This issue was resolved by me using sparse checkout; the operation works normally after restricting the checkout to files larger than 50MB. In fact, it was during debugging that an error occurred when checking out a file of 73.3MB. That's why I limited the checkout to files over 50MB.

@Zacharia2
Copy link

However, a new problem has arisen: jgit does not support sparse checkout, so while the repository can be cloned normally, the filtered-out files are considered deleted by git because they do not exist in the working directory. I am currently unable to solve the problem of ignoring this filtered file that has been staged as deleted.

@Zacharia2
Copy link

Zacharia2 commented Feb 23, 2025

I have genuinely and completely solved this problem; perhaps, during my multiple tests, the issue vanished and has not reappeared since. I tried cloning jgit and opening the project in Eclipse, then patching the InflaterCache.java file, and now it is working properly.

This is mainly due to rtyley's solution approach. Thank you very much. I have applied it here: https://github.com/Zacharia2/Android-Compatible-JGit

@maks
Copy link
Owner

maks commented Feb 23, 2025

I have genuinely and completely solved this problem; perhaps, during my multiple tests, the issue vanished and has not reappeared since. I tried cloning jgit and opening the project in Eclipse, then patching the InflaterCache.java file, and now it is working properly.

This is mainly due to rtyley's solution approach. Thank you very much. I have applied it here: https://github.com/Zacharia2/Android-Compatible-JGit

@Zacharia2 thanks for letting me know about your work. I'll try to make some time test with your patched version of jgit.
Can I confirm you tested this on Android device and which Android version it was running? as you mention opening using Eclipse which I don't believe runs on Android?

@Zacharia2
Copy link

Zacharia2 commented Feb 24, 2025

@maks Hi, hello. My device is a OnePlus Ace3 Pro, running Android 15. I cloned jgit and imported the Maven project into Eclipse. Then, I removed the projects unrelated to jgit. After that, I right-clicked on the project and selected "Run as" > "Maven install" to wait for all dependencies to be installed. Next, I applied a patch to the inflatercache and ran "Maven install" again. After that, I could find the built jar package in a folder similar to the output build in jgit. This jar package can be imported into Android Studio (AS) to complete the patching work.

Image

Image

@Zacharia2
Copy link

Perhaps you could directly try the version I built myself: https://github.com/Zacharia2/MGit/releases

@maks
Copy link
Owner

maks commented Feb 24, 2025

@Zacharia2 thanks for the explanation. I see what you mean now, you used Eclipse to build the newer version of jgit that you patched and then used that for your fork of MGit. \

The main problem with this approach is that I have been trying to keep MGit compatible with older versions of Android and by using jgit version 6 that is no longer that case as it uses file system APIs that are not available on older versions of Android but will work fine for you on Android 15.

I guess I need to consider if its worth maintaining compatibility with older versions of Android or to just draw a line and stop supporting them to be able to use a much newer version of jgit.

@Zacharia2
Copy link

Correct, that is the situation. You can use a divide-and-conquer approach, keeping the old version while continuing to support the new version. For any version of jgit, the inflatercache file needs to be patched. This is inevitable. To skip the step of patching jgit, you would need to submit a patch to jgit just once.

@Zacharia2
Copy link

Zacharia2 commented Feb 24, 2025

It seems that every version of jgit on Android requires revision (unfortunately). How about this: directly adapt jgit6 or any chosen version to manually fit the target Android version. This would also solve the problem.

Treat this version of jgit as a dedicated branch version for mgit. Although this adds some workload, it is feasible.

@maks
Copy link
Owner

maks commented Feb 25, 2025

@Zacharia2 unfortunately modifying jgit6 for older versions of Android is not an option I have time to pursue as last time I looked into it, it would be alot of work to modifying jgit to not use the newer filesystem APIs that are missing in older versions of Android, but I would be happy to make use of such a modified version of jgit6 if thats something you want to work on.

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

5 participants