Android APK freezes during level load but not in Unity Editor

I’m building a mobile game for android, and i’ve gotten pretty far with no issues. My scenes were loading properly and everything was working fine on both the Unity Editor and the Android APK until recently. I have a “Loading Page” transition into every scene. My game starts off with a splash scene, then loads to the transition “Loading Page” and then to the “Main Page”. On both the Unity Editor and the Android APK, these all load fine. In my “Main Page”, i have a “Start” button, which when clicked, it loads the “Game Page”. In the Unity Editor, when i press the “Start” button everything runs smoothly and it loads perfectly fine. When i build the Android APK and try pressing the “Start” button on mobile, it takes me to the transition “Loading Page” no problem, but then just freezes and never loads the “Game Page”. This has only started happening recently, and i have not made that many changes to my game. I went as far as to start a whole new project from scratch and building it all again and starting from today the issue has started again. I am using Photon Network, and thought that maybe that was the issue due to me just recently getting Unity_2017. I removed all Photon Network scripts and all assets from my project and loaded all scenes offline through SceneManager.LoadAsync, and am still getting the same issue… I’ve tried loading other scenes other than the “Game Page” after the transition “Loading Page” but still the same issue. I removed all 3D objects from my scenes and even went as far as to removing all 3D objects from the project entirely.

I am confused as to what is going on here. If someone has some kind of answer to this or some way i can try to resolve this it would be greatly appreciated!!! Please help!!

This is the code i am using to transition from scene to scene through the “Loading Page” :

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
using UnityEngine.EventSystems;

public class LoadingText : MonoBehaviour {

private AsyncOperation ao;
private int levelToLoad;
private string lastLoadedScene;

// Use this for initialization
IEnumerator Start () {
	lastLoadedScene = getLastLoadedScene.getLastLevel ();
	if (lastLoadedScene == "SplashNameLoad") {
		levelToLoad = 2;
	}
	else if (lastLoadedScene == "Main") {
		levelToLoad = 3;
	}
	ao = SceneManager.LoadSceneAsync (levelToLoad);
	ao.allowSceneActivation = false;
	GetComponent<Text> ().text = "Loading";
	yield return new WaitForSeconds (0.5f);
	GetComponent<Text> ().text = "Loading.";
	yield return new WaitForSeconds (0.5f);
	GetComponent<Text> ().text = "Loading..";
	yield return new WaitForSeconds (0.5f);
	GetComponent<Text> ().text = "Loading...";
	yield return new WaitForSeconds (0.5f);
	GetComponent<Text> ().text = "Loading..";
	yield return new WaitForSeconds (0.5f);
	GetComponent<Text> ().text = "Loading.";
	yield return new WaitForSeconds (0.5f);
	GetComponent<Text> ().text = "Loading";
	ao.allowSceneActivation = true;
}

}

I resolved and figured out the problem two nights actually, and it was exactly what you just mentioned. I had a Resources.load call running in the Update on a script in my “Main Page” without even realizing it. I definitely did not mean to plug it in there, but guess it got in there anyway lol. Just made it so difficult to find since no errors were pumping out and it was loading fine in the Editor. But once i removed the resources.load call from the Update everything ran smoothly again on mobile. I’ll mark and accept your answer @adrienPlayerium since you technically had the right one even though you responded after it was resolved, appreciate your answer!

@clunk47 Can you help with this, I am having same issue

Update :

<i>AndroidPlayer(samsung_SM-G928W8@192.168.2.10)</i> Unloading 6 Unused Serialized files (Serialized files now loaded: 0)

The above message comes up after i load into the “Main Page”. It unloads everything basically, which is fine and i expected that. I then tap my button to load the “Loading Page”, it loads fine. But then freezes when trying to load the “Game Page” and spits out this log message in the console :

>AndroidPlayer(samsung_SM-G928W8@192.168.2.10)</i> Unloading 0 Unused Serialized files (Serialized files now loaded: 0)

It’s not loading anything! Even though in my script it loads fine in the Editor, it just doesn’t want to load anything on the Android device… This makes no sense to me… Oh, and this log just constantly keeps spitting out endlessly until i close the app.

Hey,

In my case the problem was in a camera in a scene.
I change ‘Target Eye’ to none (main display) and ‘clear flags’ to Skybox.

Hope it will help!