Unity takes forever to load scene

Using Android 2.3.x, 512 MB of memory

I have a mobile game that has a couple of scenes. I can load each scene and play the game for a while. But if I continue to reload scenes/levels. The game will eventually hang, and never finish loading the next scene.

I removed every script incase I had a memory leak or reference issue. But it still hangs. When it is “hanging”, logcat spams this:

E/Unity ( 7659): Inflate Error: invalid code lengths set
E/Unity ( 7659):
E/Unity ( 7659): (Filename: ./PlatformDependent/AndroidPlayer/ZipFile.cpp Line: 234)
E/Unity ( 7659):
E/Unity ( 7659): Inflate Error: invalid code lengths set
E/Unity ( 7659):
E/Unity ( 7659): (Filename: ./PlatformDependent/AndroidPlayer/ZipFile.cpp Line: 234)
E/Unity ( 7659):
E/Unity ( 7659): Inflate Error: invalid code lengths set
E/Unity ( 7659):
E/Unity ( 7659): (Filename: ./PlatformDependent/AndroidPlayer/ZipFile.cpp Line: 234)
E/Unity ( 7659):

Looks like a Unity error related with loading assets.

I will receive low memory warnings before the hang happens. I check the memory left and it seems like I have alot left (100+ MB?). Maybe there is a buffer overflow somewhere? So far my best solution is to combine every scene and remove every non-essential asset (Or else I will run out of memory), so I never have to reload a scene. But I don’t think I should have to do this. I tried the empty scene as a loading screen idea but that had no improvements. If I remove assets (textures, meshes, etc) from the scenes. I can reload the scenes many more times. But it doesn’t matter what’s in the scene. A crash is guaranteed.

I made a test project, included a empty loading screen scene and a basic scene with a textured cube. After a while, the scene will fail to load and Unity won’t do anything but spam that error, the only thing I am able to do is to kill the process (or quit application). I can only kill the process if Unity is trying to loading asynchronously, if loading scene normally, the game will seem like it is frozen.

I do not believe that I am the only person in the world that has encountered this problem. But I am also completely lost and have no idea where to go from here. Any ideas? (Even accepting crazy ideas at this point!)

Looks like a bug, send in your test project and see if they can track it down.