0

Ok, I've been testing a game with several scenes. In Unity and iOS devices, everything works perfect. In Android, always crash (or freeze if you prefer). I'm using Unity 2017.2.0f3. and the line of code that crash is the next one (nextScene is a string with the value of the next scene):

 SceneManager.LoadScene (nextScene);

I've been trying other options like:

 SceneManager.LoadScene (nextScene, LoadSceneMode.Single);

But this is not working neither. The last one I tried was:

 SceneManager.UnloadSceneAsync(UIManager.Instance.currentScene);
 SceneManager.LoadScene (nextScene, LoadSceneMode.Single);

Again without success. Please I really need help with this. I've dealing with this problem for 24 hours. It's driving me crazy.

Programmer
  • 121,791
  • 22
  • 236
  • 328
iOSTony
  • 165
  • 1
  • 11
  • 1
    The first thing I would do is to create an empty scene and try to load it then see what happens. If it crashes too then use [this](https://stackoverflow.com/questions/44690357/how-to-read-debug-log-when-using-android) answer to get the log and post it in your question. The log is really important to solve your problem here – Programmer Oct 25 '17 at 22:13

1 Answers1

2

After more than 24 hours I solve the problem. I hope that my solution help other people because there isn't enough references on the web. When I created the APK file it was splitter with a second one of type OBB. This kind of files is required when the Android App is too big. In my case was set by default.

The solution was to force the creation of the APK without the OBB. To do that you must get to Player Settings in Android, go to Publishing Settings and uncheck Split Application Binary (located at the bottom).

Everything's working now and life is good again.

enter image description here

iOSTony
  • 165
  • 1
  • 11
  • Valuable answer. Though it raises the question, shouldn't you make the build smaller? – Everts Oct 26 '17 at 15:02
  • 1
    @iOSTony - I have exactly the same problem - once the script reaches `SceneManager.LoadScene("02");`, the Android app freezes. Unchecking the above checkbox however did not do the trick for me. Any other suggestions? I am using Unity 2019.2. – Angel Todorov Nov 28 '19 at 17:54