MobileChromeApps / cordova-plugin-zip

Zip plugin for Cordova apps
Other
168 stars 207 forks source link

unzip() always return -1 on Android #89

Open jammind opened 4 years ago

jammind commented 4 years ago

Mi Phone Mi MAX - Android 7.0 - MIUI 10.2 Stable No matter unzip() is successful or not or even with a wrong filename, it always returns -1. It works correctly on iOS.

jasonsultana commented 4 years ago

I'll add my 2 cents to this, since I noticed a similar issue. Running in an emulator, it seems to work fine. But running on a device yields the following (obtained from adb logcat):

06-03 21:17:33.162 18084 21917 E Zip     : An error occurred while unzipping.
06-03 21:17:33.162 18084 21917 E Zip     : java.io.EOFException
06-03 21:17:33.162 18084 21917 E Zip     :  at libcore.io.Streams.readFully(Streams.java:83)
06-03 21:17:33.162 18084 21917 E Zip     :  at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:235)
06-03 21:17:33.162 18084 21917 E Zip     :  at org.apache.cordova.Zip.unzipSync(Zip.java:119)
06-03 21:17:33.162 18084 21917 E Zip     :  at org.apache.cordova.Zip.access$000(Zip.java:23)
06-03 21:17:33.162 18084 21917 E Zip     :  at org.apache.cordova.Zip$1.run(Zip.java:39)
06-03 21:17:33.162 18084 21917 E Zip     :  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
06-03 21:17:33.162 18084 21917 E Zip     :  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
06-03 21:17:33.162 18084 21917 E Zip     :  at java.lang.Thread.run(Thread.java:818)
AntonERG commented 3 years ago

Same issue recently with Mi Note 8, also MIUI.

mariapaulinar commented 3 years ago

Same here :(

Gabriel-des commented 3 years ago

Same problem here :(

mariapaulinar commented 3 years ago

@Gabriel-des I didn't find the solution using this plugin, but I did solve it using this package: https://stuk.github.io/jszip/ supplemented with https://capacitorjs.com/docs/v2/apis/filesystem