I have a game with multiple scenes. Everything worked fine, in the Editor and on different Android devices. Then I changed some graphics today in one level, added a new texture to an object. Everything was fine in the Editor, then I wanted to finally see the result on the device, but I couldn't load the scene. I have one scene starting the game, showing a custom "splash screen" (since I don't have Android Pro). That scene automatically loads the second scene, the main menu. In that scene I select the level to load. (Btw that scene contained the new textures as a preview of the level I added the graphics to.) When I selected a level (doesn't matter which one, the one with the new textures or any other) the game freezes. I am loading the new scene with
Debug.Log("loading " + sceneToLoad);
Debug.Log("loaded " + sceneToLoad);
The scene is definitely listed in the build settings. Both debug messages get called. But from then on everything just stops. Neither Update() from that script gets called nor anything in the new scene. The frame just freezes after that call. No other debug messages than mine get written to logcat. No error message from Unity. The time scale is 1, "Split Application Binary" is not checked. I even deleted the new textures, and the scene I added them to. I changed the scene order to load the main menu first. That worked, and I was able to load a level. But when I tried to load the splash screen scene, it froze again, without any error message from Unity. Then I tried to move the level to the "Resources" folder, which had absolutely no effect. Now I changed the scene order back, so that the splash screen scene is loaded first. Now the game even crashes right after the Unity logo with
06-24 18:39:42.343: W/Unity(24147): The referenced script on this Behaviour is missing!
06-24 18:39:42.343: E/Unity(24147): A script behaviour has a different serialization layout when loading. (Read 24 bytes but expected 32 bytes)
06-24 18:39:42.343: E/Unity(24147): Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
But no, I don't use preprocessor directives for properties. I also don't get the message that something is corrupt. I tried a development build, normal build, no difference. My APK is about 35MB big. I'm really desperate right now, because I don't have time for issues like that. That project is my bachelor thesis.. No matter what I try, I always get a similar result.
I just tried to change the package name and revert my project to the state that worked yesterday. It even worked! Then I made the changes with the new graphics and I got exactly the same issue. Unity won't load any level after the main menu. Does anyone have an idea? Sounds like a Unity bug when the engine stops doing anything without any output..
Answer by hicks
Jun 26, 2013 at 12:17 PM
Ok, seems like I solved it somehow. I reverted my project to the last working state (without the new graphics) and renamed the Android package. It worked again on my device. Then I repeated all my changes manually (adding the new graphics, changing materials and prefabs). But that cannot be the correct solution. Once published, you cannot change the package name anymore! I just hope this never happens again..
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users post good questions and use the site effectively we have posted a user guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
Answers and Comments
16 People are following this question.
Android Button Text
Problem in android plugin creation.?
Android Ads Error
Error Building Android Player
cant run the apk in my android phone