iOSTony
iOSTony

Reputation: 165

SceneManager.LoadScene is crashing for Android Devices

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.

Upvotes: 0

Views: 1520

Answers (1)

iOSTony
iOSTony

Reputation: 165

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

Upvotes: 2

Related Questions