The file 'MemoryStream' is corrupted!

Hi, i am having some problems with bundles, getting the error below

25/6/2010 16:45:10 [ERROR] {Unity} The file 'MemoryStream' is corrupted! Remove it and launch unity again!

[Position out of bounds!] UnityEngine.Object:Internal_CloneSingle(Object)

UnityEngine.Object:Internal_CloneSingle(Object)

UnityEngine.Object:Instantiate(Object)

...

This occurs when i call the instantiate of some prefab that have been loaded from a bundle file.

Has Anybody already seen this? Any idea of how i can solve this problem?

Thanks.

FYI, I hit this today. Submitted the bug to Unity, but unless they grab the extended folders I doubt they can replicate it easily.

I have a project that I had to move from Unity 5.2 back to Unity 5.1. Unsure if thats part of the cause.

Everything has been working great. However, today as part of my testing, I had to flood a response back to our web component. This involved creating a MASSIVE string until everything crashed.

When it crashed, I had the error appear:

The file “MemoryStream” is corrupted!
[Invalid Positions!]

Or something therein. Launching the project would generate this error a whole ton of times. And the scene would say the timestamps are invalid, and wipe the references for every single file in the scene. No matter how many times I reset the scene or dumped the changes in sourcetree it would replicate it self.

Further, there is no MemoryStream file. So what I did was delete the Libraries folder, obj folder, cleared all temp files, and for safety re-installed Unity 5.1.4.

Launching the scene everything is back to working order. I highly suspect, that just wiping the Library folder would resolve this for most people, but remember to make sure not to save the scene file (File>Save inside the editor) if you see this error, or the scene will save with missing references.

This looks like a bug. If it reproduces, could you be so kind to send it to us using UnityMenu->Help->Report a problem? Thanks, Lucas

I also encountered the same problem when loading assetbundle.
and it seems that it only happens in WebPlayer

I got the same error in Windows project settings, build in on the Vive Multiplayer Unity 5.4.1, submitted bug… and will try said delete files method.

Thanks

-Mark

I got the same error in Windows project settings, build in on the Unity 2018.4.25f
when i import some assets and it loading the assemblies
expediently i closed vs 2019 community then it show me the error
171327-error.png
Unloading broken assembly Library/ScriptAssemblies/Assembly-CSharp.dll, this assembly can cause crashes in the runtime

show this and unity closed

Go in Editor>UnityRemote>Device. Set to “None”. Save this config and close Unity.
Reopen Unity.