- Home /
Cannot import Unity Serializer(save&load)
Hello,
I want to add a save/load function in my Augmented reality project (Vuforia).I have found a nice Unity Serializer packageV2.51. (http://whydoidoit.com/unityserializer/).
After i imported the package in my Vuforia project, there are error message shown in my unity editor.
Assets/Plugins/Editor/Unzip.js(12,25): BCE0004: Ambiguous reference 'ZipEntry': ICSharpCode.SharpZipLib.Zip.ZipEntry, ICSharpCode.SharpZipLib.Zip.ZipEntry.
However, if i create a empty project with Unity Serializer packageV2.51 only, no error message in the editor.
Is it crash in Vuforia and Unity Serializer?
Thank you.
Answer by whydoidoit · Feb 24, 2014 at 04:15 AM
You have managed to get two copies of ICSharpCode.SharpZipLib in the project. Work out which one is newer and delete the older one.
If you search your project of ZipEntry you should be able to identify the two locations.
Hello,
you mean i need to delete one of the two ZipEntry.cs file in my project? However, i found a ZipEntry.cs only.
Also, only one (namespace ICSharpCode.SharpZipLib.Zip) in ZipEntry
Hmmm, odd. Well the error message says you have two!
I wrote Unity Serializer and I use Vuforia in my project - I normalised out so I only have one copy of the SharpZipLib.dll - perhaps you have two of those?
Yeah, you are right. Im so confuse that what is the meaning of the error messgae.
Only one zipEntry.cs in \Plugins\whydoidoit\SharpZIP\src i can found.
It is the error message code file - Unzip.js Also, i cannot found a SharpZipLib.dll in my Asset
import System.IO.File;
import System.IO.Stream;
import ICSharpCode.SharpZipLib.Core;
import ICSharpCode.SharpZipLib.Zip;
// this script unzips a container at a given path and returns a input stream to a given file in this container
public static function Unzip(path : String, fileName : String)
{
var fileStream = OpenRead(path);
var zipFile = new ZipFile(fileStream);
for (var zipEntry : ZipEntry in zipFile)
{
if (zipEntry.Name == fileName)
{
return zipFile.GetInputStream(zipEntry);
}
}
return;
}
Hello, i have found number of "ICSharpCode.SharpZipLib" in my UNITY folder, not in project file. Which one should i delete? However, i dont know which one is newer and older, all of them in a same modify date.
Thank you
Answer by Voronoi · Aug 03, 2014 at 04:40 PM
I had this same problem and I'm sure it's because Vuforia includes this library in it's dll. I'm on a Mac, so not sure how to 'normalize' the project as whydoidoit suggested and could not find a duplicate entry in any of the scripts by searching.
What did work was to Refactor/Rename ZipEntry to mZipEntry to provide a unique name for the class. Hope this helps someone else!