Any way to unzip file on react-native

2019-07-21 05:50发布

问题:

Managed to download .zip file to my filesystem on mobile phone. But after a while realised I can't find a way how to unzip that file. As I tried with:

  • https://github.com/plrthink/react-native-zip-archive
  • https://github.com/remobile/react-native-zip

First one dies immidiately after requiring, getting error "Cannot read property 'unzip' of undefined" (followed instructions carefully)

And the second one dies because it's dependant on codrova port to react native which also doesn't work.

Any suggestions or way to solve these problems?

Using react-native 0.35, testing on Note4 with android 5.1.1.

回答1:

I did manage in the end solve my problem:

using react-native-zip-archive

the solution was to change code inside: RNZipArchiveModule.java file which is inside module

The changes that needed to be applied are written in this comment: https://github.com/plrthink/react-native-zip-archive/issues/14#issuecomment-261712319

So credits to hujiudeyang for solving problem.