plugin .zip on enterprise?

Hi…

I want ask if the plugin .zip is in corona enterprise or i can use it with starter version? 

You can use it with any version of Corona:

https://docs.coronalabs.com/plugin/zip/

cool.
Thanks for your answer.
However i’ve a problem in android os.

When i try tu unzip file from temporanydirectory to document or resource directory my app crashes without errors.

On simulator all ok and during build nothing allert appear.

When you say with no errors, do you mean no on-screen errors or no errors in the device’s console log?

If you need help with accessing the device’s console.log, please see: http://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

Hi rob…Nothing on screen and on console log…On my mac all run fine. The file is unzipped on document directory and i tested also in resource directory.

You’re probably going to need to share some code.

Rob

this is the function where the app crashes. 

– function zip 

function b.unzipped()

       --LISTENER PLUGIN ZIP

            local function zipListener( event )

                            local gruss = display.newGroup( )

                            local Text2 = “”

                if ( event.isError ) then

                     Text2 = “Error!” --TEXT ERROR

                

                else

                   

                      Text2 = “Download succesfull !” --TEXT SUCCESS

                end

                              --SCREEN SUCCES/FAILURE

                              local rect = display.newRoundedRect( display.contentCenterX,display.contentCenterY,300,200,5 )

                              rect:setFillColor( 1,1,1 )

                              gruss:insert(rect)

                              local text1 = display.newText( Text2,display.contentCenterX,display.contentCenterY,native.systemFontBold,18 )

                              text1:setFillColor( 0.4,0,0 )

                              gruss:insert(text1)

                     – FUNCTION LISTENER TO REMOVE GROUP

                     local function listener2(event)

                          if event.phase == “ended” then 

                               rect:removeEventListener( “touch”, listener2 )

                               gruss:removeSelf()

                               gruss = nil

                          end 

                     end 

               

                    rect:addEventListener( “touch”, listener2 )

            end

– PLUGIN .ZIP

                local zipOptions =

                {

                    zipFile = “fish.zip”,

                    zipBaseDir = system.TemporaryDirectory,

                    dstBaseDir = system.ResourceDirectory,

                    listener = zipListener

                }

                zip.uncompress( zipOptions )

end

system.ResourcesDirectory is read only. You cannot have it as a destination.

Rob

i tried also system.DocumentsDirectory, but the problem is the same.

Based on the code it has to be drawing text2 to the screen. You can also dump the event table to the console. Near the top of your program:

local json = require( "json" )

Then inside your listener:

       --LISTENER PLUGIN ZIP             local function zipListener( event )                             local gruss = display.newGroup( )                             local Text2 = ""                             print( json.prettify( event ) )

Then you can look at your console log and see what it’s outputting. Since it’s erroring on device, you need to look at the device’s console log. If you don’t know how to do that, please read: http://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

today i tried again to insert documentsdirectory in dstBaseDir. Now it work. I don’t know why last time it didn’t work, but i suspect that i wrote bad “system.DocumentsDirectory”.

Thanks much for your support and sorry for trouble.

Glad it’s working.

You can use it with any version of Corona:

https://docs.coronalabs.com/plugin/zip/

cool.
Thanks for your answer.
However i’ve a problem in android os.

When i try tu unzip file from temporanydirectory to document or resource directory my app crashes without errors.

On simulator all ok and during build nothing allert appear.

When you say with no errors, do you mean no on-screen errors or no errors in the device’s console log?

If you need help with accessing the device’s console.log, please see: http://docs.coronalabs.com/guide/basics/debugging/index.html

Rob

Hi rob…Nothing on screen and on console log…On my mac all run fine. The file is unzipped on document directory and i tested also in resource directory.

You’re probably going to need to share some code.

Rob

this is the function where the app crashes. 

– function zip 

function b.unzipped()

       --LISTENER PLUGIN ZIP

            local function zipListener( event )

                            local gruss = display.newGroup( )

                            local Text2 = “”

                if ( event.isError ) then

                     Text2 = “Error!” --TEXT ERROR

                

                else

                   

                      Text2 = “Download succesfull !” --TEXT SUCCESS

                end

                              --SCREEN SUCCES/FAILURE

                              local rect = display.newRoundedRect( display.contentCenterX,display.contentCenterY,300,200,5 )

                              rect:setFillColor( 1,1,1 )

                              gruss:insert(rect)

                              local text1 = display.newText( Text2,display.contentCenterX,display.contentCenterY,native.systemFontBold,18 )

                              text1:setFillColor( 0.4,0,0 )

                              gruss:insert(text1)

                     – FUNCTION LISTENER TO REMOVE GROUP

                     local function listener2(event)

                          if event.phase == “ended” then 

                               rect:removeEventListener( “touch”, listener2 )

                               gruss:removeSelf()

                               gruss = nil

                          end 

                     end 

               

                    rect:addEventListener( “touch”, listener2 )

            end

– PLUGIN .ZIP

                local zipOptions =

                {

                    zipFile = “fish.zip”,

                    zipBaseDir = system.TemporaryDirectory,

                    dstBaseDir = system.ResourceDirectory,

                    listener = zipListener

                }

                zip.uncompress( zipOptions )

end

system.ResourcesDirectory is read only. You cannot have it as a destination.

Rob

i tried also system.DocumentsDirectory, but the problem is the same.