I have a (very simple) loading screen implemented, and it works flawlessly on iOS and web builds. Unfortunately, it causes a crash 100% of the time on Android builds. On a non-Development Build, some loading takes place before the crash (about 60-70%), but if I make a Development Build, the crash occurs as soon as my loading screen is shown. If I remove the loading scene, the game runs fine on all platforms, barring a watchdog kill.
I recognize that this may not be a LoadLevelAsync crash. There may be some asset that is unable to properly async-load only on Android, but since I can’t get any messaging out of LoadLevelAsync to let me know what is being loaded when the crash occurs, I’m flying blind. Any debugging tricks for this situation for a moderately-sized game would be appreciated as well.
Here’s my loading code. This is placed on an object in the loading scene.
public string LevelToLoad;
AsyncOperation async;
IEnumerator Start()
{
//Debug.Log("Started Loading...");
async = Application.LoadLevelAsync(LevelToLoad);
yield return async;
}
void Update()
{
//Debug.Log("Loading Progress: " + async.progress * 100);
//ProgressSprite is an object of a custom loading sprite class,
//but contains no surprises.
ProgressSprite.fillAmount = async.progress;
}