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”}
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. You’ve been using the library for a while already?
@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.
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:
If you’ve not already done so, set up the file structure described here, so Solar2DPlugins → com.coronalabs → plugin.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.
As I understand it, I had to drop your build into an empty folder “Solar2DPlugins\com.coronalabs\plugin.zip\android”.
AndroidEmulator - error, Win - ok
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. If not I’ll try to get another PR together later.)
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: