We’re building to iOS, and on-device I’m getting the following error in Xcode:
SplashScreenController only exists in the generated Xcode project, under: Unity-iPhone/Classes/UI/SplashScreen.{h|mm}
From some searching around, it looks like this might happen when some UI controllers are switching rapidly between views, but as this is happening (apparently) on the splash screen, and it’s a part of the generated code, I’m not sure how to proceed.
i have the same problem. In Xcode i give that error and sometimes, without specific pattern, my app remains stuck on black screen on startup and crash. Did anyone solve this?
I’ve been stuck with this same problem. I have tried various Unity versions and even with empty projects, all producing the same result. The splash screen is displayed for an unnaturally long amount of time. The empty projects will have it up for 8-12 seconds before if launches the application. For my full size project, it can take anywhere from 20-60 seconds.
If there is not a splash screen set, then the screen is just black. For those longer load times, the OS seems to be killing the app for being unresponsive.
I was able to reduce those times by changes the compression method in the build settings to “LZ4HC”. This still didn’t fix the problem. I suspect that there is a compatibility issue between Unity and Xcode versions. I will try to mess around with the versions to see if that helps narrow it down at all.
Showed up for me in a brand new build Unity 2020.1.14f1, XCode Version 12.2 (12B45b). App was never on device before and never built on this computer before.
2020-11-23 10:07:21.744099-0500 xxxxxxxxxx[3561:1014107] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x100c05510>. Has to be the splash screen settings. Will fiddle with those. Not preventing app from running.
This is still happening in Unity 2020.2.2. I’d like to confirm what others have said. Adjusting the splash screen settings fixes the problem. If you have Unity Plus/Pro, you can simply uncheck the setting for showing the splashing screen (under Project Settings->Player->Splash Screen->iOS).
Hi
I tried to add the unityview(Unity as framework) to a viewcontroller. Then If I add unity in viewDidappear I am getting an error like below
Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x1065071b0>.
It works fine when I add it in a button click. Any thought on this?
Can you elaborate on what you said: “Adjusting the splash screen settings fixes the problem.” ? What settings did you adjust and how?
I have been having issues with initial loading time (and a black screen) for a while now. I’ve lived with it in the past but I want to fix this now. On the version I have now 2019.4.21 it seems better (the hang time has gone down, it seems), but the error message still appears.
I believe there are multiple causes of black screen then crash on iOS (often with the unbalanced calls log event).
For one project disabling the splash screen seemed to avoid the Unity bug. In Unity 2020 you can just uncheck here Project Settings->Player->Splash Screen->iOS.
For another project (Unity 2020) that was using ECS / Dots, adding ENABLE_HYBRID_RENDERER_V2 to the symbols fixed this black screen then crash at launch problem.
For another iOS project that using Unity 2019, I changed the renderer from Metal to OpenGL3. This avoided the Unity bug. In Unity 2020, OpenGL is no longer an option on iOS. Since you are still using Unity 2019, you might want to try this.
For folks getting iOS crashes at launch, another thing to try:
In XCode’s build settings, remove UnityFramework.framework then add it back again.
This seemed to be needed if using both Firebase, AdMob, and Facebook SDKs (in the same project) in Unity 2019 and 2020. This avoids an iOS crash on launch.
If you are using a build script, you can automate this step with code like this:
[PostProcessBuild(150)]
public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
{
// Read
string projectPath = PBXProject.GetPBXProjectPath(path);
PBXProject project = new PBXProject();
project.ReadFromString(File.ReadAllText(projectPath));
//string targetName = PBXProject.GetUnityTargetName(); // note, not "project." ...
string targetGUID = project.GetUnityMainTargetGuid();// project.TargetGuidByName(targetName);
//Frameworks to add
project.RemoveFrameworkFromProject(targetGUID, "UnityFramework.framework"); // attempting to fix crash on launch for iOS (We did this step for Road Puzzles when trying to get the FB, AdMob, and Firebase SDKs to work together)
project.AddFrameworkToProject(targetGUID, "UnityFramework.framework", false);
project.AddFrameworkToProject(targetGUID, "StoreKit.framework", false);
// Write
File.WriteAllText(projectPath, project.WriteToString());
}
I also got this problem having splash screen not showing and load for like 20+ seconds to see the game screen (not sure if those 2 problems are related)
updated: Solved. In Unity Build Settings, add your Scene into “Scenes In Build” and opt it in, then opt “Scenes/SampleScene” out. After it, Build .xcodeproj.
Same problem with super simple 2D Unity app that consists 1 Scene, 7 static images, 2 Controllers, 1 Generator and 1 Director. The project is created as unity Hub default 2D.
2021-08-14 18:44:50.155287+0900 CatEscape[651:26382] Built from '2020.3/staging' branch, Version '2020.3.16f1 (049d6eca3c44)', Build type 'Release', Scripting Backend 'il2cpp'
2021-08-14 18:44:50.156534+0900 CatEscape[651:26382] MemoryManager: Using 'Default' Allocator.
-> applicationDidFinishLaunching()
2021-08-14 18:44:50.237749+0900 CatEscape[651:26382] Metal GPU Frame Capture Enabled
2021-08-14 18:44:50.237998+0900 CatEscape[651:26382] Metal API Validation Enabled
2021-08-14 18:44:50.305691+0900 CatEscape[651:26382] fopen failed for data file: errno = 2 (No such file or directory)
2021-08-14 18:44:50.305736+0900 CatEscape[651:26382] Errors found! Invalidating cache...
-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Initializing Metal device caps: Apple A14 GPU
Initialize engine version: 2020.3.16f1 (049d6eca3c44)
2021-08-14 18:44:50.949848+0900 CatEscape[651:26640] fopen failed for data file: errno = 2 (No such file or directory)
2021-08-14 18:44:50.949920+0900 CatEscape[651:26640] Errors found! Invalidating cache...
2021-08-14 18:44:51.086762+0900 CatEscape[651:26382] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x104750220>.
UnloadTime: 0.454250 ms
I tried things following Mark-Currie’s posts here but not solved.
Are there anything I can try more?
macOS : Big Sur 11.5.1
Unity : 2020.3.16f1 Personal
Xcode : 12.5.1
Are you sure that’s not an empty default scene you’re seeing? If you have multiple scenes in your project you need to set the default scene in the build settings.
Hi. I got the same error and in my case I forgot to add Splash Screen Scene in my build setting. as soon I added it. my issue was resolved. because I had all the initialisations in my splash screens that’s why it stuck after loading screen. and the error message in Xcode logs was the same as yours.