I’ve got a problem with screen loading issue in iOS build, It works well in Android but the same build is not working properly in iOS.
While loading to the other screen sometimes it takes time to load and sometimes it may crash with an error in Xcode console.
iOS Console Error: “Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors) (IOAF code 4)”.
I wrote this code in my game manager script for loading the screen.
AsyncOperation asyncOperationScene = SceneManager.LoadSceneAsync("level"+ (DataManager.levelNumber + 1), LoadSceneMode.Additive);
loadingPanel.GetComponent<LoadingLevels>().async = asyncOperationScene;
loadingPanel.SetActive(true);
asyncOperationScene.completed += AsyncOperationScene_completed;
If someone could enlighten me I would really appreciate it!
Thanks for your time!
After search some on internet, maby your problem is not related to the loading way of the scene, but the scene has some problems with lighting or shader, I have read about some other guys have similar problem and is related to some drivers of new phones that has changed and then unity its working with it , but it also has to do with custom shader things that need to be different , so many your error doesn’t come from the loader way of the scene , but from some material , I have read that it can be something about ambient lighting and exr. files , wish to help more but that’s was what I can share with you.
Anyways would be nice for all of us that you share here the debug log where we can see whats going on and particular to you make sure that is not about loading the scene but something that the scene you try to load had something that its not well for this new phones and their driver related to lightmapping shaders etc.
Thanks for your response, In my script I added some other functions like clear cache memories once I commented those code for cache memory then the scene loading issues resolved.
Let me represent my codes, Someone please go through it and do let me know where it is correct or having some mistakes on it.
void ClearMemory()
{
MediaPlayer[] ar_mp = FindObjectsOfType<MediaPlayer>();
foreach (MediaPlayer mp in ar_mp)
{
mp.CloseVideo();
}
Caching.ClearCache();
Resources.UnloadUnusedAssets();
GL.Clear(true, true, Color.green);
GL.Flush();
}