Uncompress function is not working on Android

Hi! I am using uncompress function from zip plugin. It works for Mac and iOS, but it is not working on my Android device (Android v. 11).

Error message:
photo1669912638

Code:

    local zipOptions = {
        zipFile = clmFilePath,
        zipBaseDir = system.DocumentsDirectory,
        dstBaseDir = system.DocumentsDirectory,
        listener = zipListener,
        password = zipPassword
    }
    zip.uncompress(zipOptions)

Well, that is arguably a useless error message. :stuck_out_tongue: I guess the plugin should be updated on that front, I remember there having been issues about that before.

My first question would be if you’re certain that the zip file exists in the location you’re trying to extract it from?

You could first run a check to see that the file is there. If it is, then try to extract it. If you’re still seeing problems, you could see if having a password is causing issues and try the same approach but with a file that doesn’t require a password.

Thanks for the answer!

It worked after I removed password check (and removed password from zip archive).

But now I have different problem with html file access. Web view is not working, but html page opens using system.pathForFile() function.

system.openURL(system.pathForFile(clmFilePath, system.DocumentsDirectory))

Web view gives the following error: net::ERR_ACCESS_DENIED

I don’t remember if this was for Android and/or iOS, but you can try: webView:setNativeProperty("setAllowFileAccess", true)

1 Like

Thanks! I will try it.
I also found that for API Level > 30 the default value was changed from true to false, so another solution is to build with lower Android API version.