3

I have been using the ZipArchive component for Xamarin iOS development without any issues until the 'unified' code requirement has been enforced.

There is not a unified version of ZipArchive available. I have tried ZipStorer, DotNetZip, SharpCompress, SharpZipLib all without success.

Is it no longer possible to unzip a file on an iOS device using the unified code approach?

David Berry
  • 40,941
  • 12
  • 84
  • 95

1 Answers1

1

I was searching about this because I'm trying to accomplish something with zip files and I need to unzip them, but as many pointed out ZipArchive or others don't seem to work, so I was checking on google and found this:

http://www.buildinsider.net/mobile/xamarintips/0032

which basically points out to use these references:

System.IO.Compression

System.IO.Compression.FileSystem

Then just put these usings:

using System.IO;

using System.IO.Compression;

And to do the zip/unzip:

ZipFile.CreateFromDirectory(sourcepathDirName,destinationFileName);

ZipFile.ExtractToDirectory(sourcepathFileName, destinationDirName);

Hope it helps, it worked for me at least.

Darkshogun
  • 11
  • 3
  • Sorry this didn't help as it won't compile in Xamarin under a unified code project only under a 'classic' project without 64bit support. – Tanis Draven Feb 17 '15 at 15:45
  • Well this did worked for me, on an unified code project so if it doesn't it must be something else, just to let you know the link to where I got this information asks you to create a unified API iPhone project for the example so all in all this should work as it did for me. – Darkshogun Feb 26 '15 at 04:31
  • This solved the build errors, but now I get a stack overflow (ahh, the irony), any ideas? – Kent Robin Apr 14 '15 at 13:55
  • I guess you have to put up a piece of your code, it might be something completely different from the Zip thing. – Darkshogun Apr 16 '15 at 21:58