last version of zip(2020.3627) not working correctly on Android

Hi all!

For the second day I have been trying to unpack the archive in different ways. 2 days of torment and impotence… It turns out that @vlads updated the zip library just 2 days ago! Link: https://github.com/coronalabs/com.coronalabs-plugin.zip/pull/2 and now unzipping doesn’t work correctly! The files themselves are unpacked, but the folders that are in the archive and the files with them are not unpacked, although they are taken into account in event.response!

Example:
data.zip = {“test.txt”, “dir/dir/img.png”}
Result of unZip:
only “test.txt” and nothing more
But in event.response we have correct list: {“test.txt”, “dir/”, “dir/dir/”, “dir/dir/img.png”}

PS. on Win10 all works! But not on Android…

Hmm, weird. I only made some changes to compress, basically to add directories as a capability. Were you using that at all, or only uncompress? If the latter, not sure what’s up. :smile: You’ve been using the library for a while already?

need to use only uncompress()

yes, Everything worked fine before your update.

@StarCrunch Oke, lets try this com.coronalabs-plugin.zip/src/Corona at master · coronalabs/com.coronalabs-plugin.zip · GitHub add some folder with some file in archive.zip
i got this on win10:

21:20:08.394  ------------------
21:20:08.394  {
21:20:08.394    "errorMessage":"",
21:20:08.394    "name":"zip",
21:20:08.394    "response":[{
21:20:08.394        "file":"folder/",
21:20:08.394        "ratio":0,
21:20:08.394        "size":0
21:20:08.394      },{
21:20:08.394        "file":"folder/_CoronaSplashScreen.png",
21:20:08.394        "ratio":89,
21:20:08.394        "size":34468
21:20:08.394      },{
21:20:08.394        "file":"helloCopyA.png",
21:20:08.394        "ratio":92,
21:20:08.394        "size":2796
21:20:08.394      },{
21:20:08.394        "file":"helloCopyB.png",
21:20:08.394        "ratio":92,
21:20:08.394        "size":2796
21:20:08.394      },{
21:20:08.394        "file":"helloCopyC.png",
21:20:08.394        "ratio":92,
21:20:08.394        "size":2796
21:20:08.394      }],
21:20:08.394    "type":"list",
21:20:08.394    "isError":false
21:20:08.394  }
21:20:09.878  ------------------
21:20:09.878  {
21:20:09.878    "errorMessage":"",
21:20:09.878    "isError":true,
21:20:09.878    "name":"zip",
21:20:09.878    "response":["folder/","folder/_CoronaSplashScreen.png"],
21:20:09.878    "type":"uncompress"
21:20:09.878  }

without folder with file in archive.zip all work cool with no problem

@redbol Could you send that zip, from your last post? I’m seeing very slightly different behavior with my own (from the built-in “Send to → Compressed (zipped) folder” option. I don’t get those two folders in the response, so I’d like to see what error that triggers.

I’m really not sure what Android would do differently, but I’ll see if I can figure it out.

archive.zip (38.3 KB)
There is

I just repack my zip file and add some “display Console” to see output if event.isError is true. That what I got on win10 Emulator and on AndroidEmulator:


As You can see, there no unzipped folder on AndroidEmu
There is my project files:
test.zip (211.6 KB)

I have the same problem,
on android devices the subfolders are not created

If it helps, Up to 15 days ago everything was ok

Best Regards
Pasquale Lanzieri

PS: corona version 3674 on Mac

1 Like

@vlads its possible to turn off automatically download of plugins from github to latest versions?

@redbol Could you try it with these builds?

zip.zip (1.1 MB)

If you’ve not already done so, set up the file structure described here, so Solar2DPluginscom.coronalabsplugin.zip(platforms)data.tgz.

There were problems with the directories. These are even slightly random, it seems. It’s possible it was broken before but the earlier Android zlib was letting it go; that’s my best guess.

If this seems to be better I’ll try to submit a new version on Monday.

I’ve been on a wild goose chase trying to chase down some weird file bug that was getting in the way of Windows testing, so didn’t send this earlier.

1 Like

Easiest way is to download required tgz and replace it inside Caches directory in Solar2DPlugins.

Ye that what I did… But also Compiling of .apk will start update Caches directory in Solar2D Plugins with latest versions automatically.

Uncompress function working correct on both platforms! :relaxed: :star_struck: Thank you so much!

There another report with your builds(zip.zip (1.1 MB)):
AndroidEmu(no error) and Win(still do not compression):

Hey! I rebuild a zip plugin with older SDK. Please, check if it works for you
(replage data.tgz with this file).
I will release this one soon.

As I understand it, I had to drop your build into an empty folder “Solar2DPlugins\com.coronalabs\plugin.zip\android”.
AndroidEmulator - error, Win - ok

I uploaded version to the repository. Just delete whole Solar2DPlugins directory to get the latest

Oke, i did. But i get same result

@redbol Could you try again with this (Windows) build?

data.tgz (39.1 KB)

Also, you might want to manually remove any files from your documents / temporary directories first.

You might have been seeing the effects of “some weird file bug that was getting in the way of Windows testing”, especially if you had relaunched. (I’m not sure why I didn’t see it in your test; maybe one of us adapted it in the meantime.)

I just found a major issue: list() never closes the zip file, so clearFiles(true) can’t remove it. I’m still not quite sure why this was breaking compress() on my end (rather than just piling up entries), but fixing that seems to have addressed it.

(I left some debug info in my last build by mistake–those “O?” and “!!!” you see–but on purpose this time, in case you get an error and show another image. :smiley: If not I’ll try to get another PR together later.)

I put yout build in “Solar2DPlugins\plugin.zip\win32-sim”
Deleted all files and folders in temporary directories of App
Run App, got this:

Oke, nothing changed…

After i deleted folder “Solar2DPlugins\plugin.zip”. Deleted all files and folders in temporary directories of App.
Put your new build in “Corona Simulator\Plugins\plugin.zip” and extract “plugin_zip.dll” from “data.tar” in “Corona Simulator\Plugins”. Run App:

But im not sure, what do You wanna test, bcs all works on Win