- Home /
Android level doesn't want to work after Application.LoadLevel
I made an entire game level (not very big) and made a simple menu with a "START" button. On the PC everything worked fine, but after installing it on two different devices the game crashes after a while loading the level. The menu loads fine, the button works (I made it dissapear before loading the level) but the level just wouldn't work. I created an empty level, using the same player prefab and a simple empty terrain and it loads fast and works fine! The size of my .apk is 110 mb, if it can help... Please tell me what to do!
Lots of people have experienced this very issue when loading a level from OnGUI.
Use OnGUI as a trigger but perform loadlevel in a separate function.
When you run it in the editor and load the level, are there absolutely no errors in the console at all? Errors may crash the app on the device but may not be obvious in the editor (for example, a null pointer exception).
Answer by haim96 · Dec 02, 2013 at 06:06 PM
Hi,
i had also issues with android, every thing look fine on PC but on android thing goes wrong. to find out what is go wrong i did the following:
in your android SDK you should have file named "monitor.bat". it should be in a folder named "tools". open this monitor and run your app while your device connected to the USB in debug mode. make sure you can see your device on the device panel (upper left). if you don't pull it out and reconnect it again. if still not work make sure your android device have proper usb driver installed (check device manager).
after you got your device connected run the app and look at the bottom section. this is the run time log (also called catlog). you may find there run time errors that unity doesn't show on editor. in my case i had reference to missing prefab. not sure how the editor skipped that but he did. hope this will help you some how.... good luck!
by the way, if you able to "build and run" from unity the monitor should work fine...
well, this is not s solution but a way to find a solution. did you look at the log? any strange red lines (error)?
i'm almost convinced that if things doesn't work only in android these should pop in run time.