Search Unity

Unbalanced calls to begin/end appearance transitions for SplashScreenController

Discussion in 'iOS and tvOS' started by nickfourtimes, Aug 1, 2019.

  1. nickfourtimes

    nickfourtimes

    Joined:
    Oct 13, 2010
    Posts:
    219
    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.
     
  2. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    797
    We are also seeing this on a tvOS build. Happens at launch. Nothing but a black screen.

    Code (CSharp):
    1. Unbalanced calls to begin/end appearance transitions for <SplashScreenController: 0x129e30090>.
     
  3. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    797
    I think in my case it might be because I hadn't assigned sprites in the splash screen settings. Sorry.
     
  4. canyon_gyh

    canyon_gyh

    Joined:
    Aug 15, 2018
    Posts:
    48
    How do you solve the problem?
     
  5. Becreatives

    Becreatives

    Joined:
    Apr 17, 2018
    Posts:
    17
    HI everyone,

    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?
     
    AcTitan likes this.
  6. madtufguy

    madtufguy

    Joined:
    Oct 26, 2016
    Posts:
    1
    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.
     
  7. IdeaLump

    IdeaLump

    Joined:
    Jun 21, 2018
    Posts:
    14
    hey guys
    we solve this by doing :
    - Delete the app from device before build
    - Use Xcode 11.3.1
    - Clean Xcode Project (Product => Clean)
    - Build The project

    We don't know if this would help, but it worked for us.

    Good Luck
     
    richardfu71 likes this.
  8. akeplinger

    akeplinger

    Joined:
    Oct 26, 2008
    Posts:
    57
    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.
     
    Mark-Currie and AdamBebko like this.
  9. Mark-Currie

    Mark-Currie

    Joined:
    Sep 6, 2012
    Posts:
    54
    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).
     
  10. Soumya-Basheer

    Soumya-Basheer

    Joined:
    Jul 22, 2015
    Posts:
    8
    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?
     
  11. glacuesta

    glacuesta

    Joined:
    Nov 30, 2017
    Posts:
    10
    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.
     
  12. Mark-Currie

    Mark-Currie

    Joined:
    Sep 6, 2012
    Posts:
    54
    I believe there are multiple causes of black screen then crash on iOS (often with the unbalanced calls log event).

    1) 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.
    2) 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.
    3) 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.

    There are likely other causes as well. Good luck.
     
    nijingtech_DEV likes this.
  13. Mark-Currie

    Mark-Currie

    Joined:
    Sep 6, 2012
    Posts:
    54
    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:

    Code (CSharp):
    1.     [PostProcessBuild(150)]
    2.     public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
    3.     {
    4.         // Read
    5.         string projectPath = PBXProject.GetPBXProjectPath(path);
    6.         PBXProject project = new PBXProject();
    7.         project.ReadFromString(File.ReadAllText(projectPath));
    8.         //string targetName = PBXProject.GetUnityTargetName(); // note, not "project." ...
    9.         string targetGUID = project.GetUnityMainTargetGuid();// project.TargetGuidByName(targetName);
    10.  
    11.         //Frameworks to add
    12.         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)
    13.         project.AddFrameworkToProject(targetGUID, "UnityFramework.framework", false);
    14.  
    15.         project.AddFrameworkToProject(targetGUID, "StoreKit.framework", false);
    16.  
    17.         // Write
    18.         File.WriteAllText(projectPath, project.WriteToString());
    19.     }
    20.  
     
    Last edited: Mar 10, 2021
  14. richardfu71

    richardfu71

    Joined:
    Mar 26, 2014
    Posts:
    4
    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)

    I'm in Unity 2020.3.13.
     
  15. yawsxx

    yawsxx

    Joined:
    Aug 14, 2021
    Posts:
    1
    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.

    Code (CSharp):
    1. 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'
    2. 2021-08-14 18:44:50.156534+0900 CatEscape[651:26382] MemoryManager: Using 'Default' Allocator.
    3. -> applicationDidFinishLaunching()
    4. 2021-08-14 18:44:50.237749+0900 CatEscape[651:26382] Metal GPU Frame Capture Enabled
    5. 2021-08-14 18:44:50.237998+0900 CatEscape[651:26382] Metal API Validation Enabled
    6. 2021-08-14 18:44:50.305691+0900 CatEscape[651:26382] fopen failed for data file: errno = 2 (No such file or directory)
    7. 2021-08-14 18:44:50.305736+0900 CatEscape[651:26382] Errors found! Invalidating cache...
    8. -> applicationDidBecomeActive()
    9. GfxDevice: creating device client; threaded=1
    10. Initializing Metal device caps: Apple A14 GPU
    11. Initialize engine version: 2020.3.16f1 (049d6eca3c44)
    12. 2021-08-14 18:44:50.949848+0900 CatEscape[651:26640] fopen failed for data file: errno = 2 (No such file or directory)
    13. 2021-08-14 18:44:50.949920+0900 CatEscape[651:26640] Errors found! Invalidating cache...
    14. 2021-08-14 18:44:51.086762+0900 CatEscape[651:26382] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x104750220>.
    15. UnloadTime: 0.454250 ms
    16.  
    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
     
    Last edited: Aug 14, 2021
  16. zhouxiang

    zhouxiang

    Joined:
    Jul 7, 2021
    Posts:
    1
    i am facing same problom.when the unity splash logo gone,the game scrren go to blue,and stuck there,just blue backgroud.

    the xcode version is 12.5.1.
    unity version is 2020.3.16f1
    the test device is ipad 8th generation.

    the error log in xcode is:

    Code (CSharp):
    1. 2021-08-15 17:34:32.794183+0800 SlotsKing[1743:971425] Built from '2020.3/staging' branch, Version '2020.3.16f1 (049d6eca3c44)', Build type 'Release', Scripting Backend 'il2cpp'
    2. 2021-08-15 17:34:32.795739+0800 SlotsKing[1743:971425] MemoryManager: Using 'Default' Allocator.
    3. -> applicationDidFinishLaunching()
    4. 2021-08-15 17:34:32.833910+0800 SlotsKing[1743:971425] Metal GPU Frame Capture Enabled
    5. 2021-08-15 17:34:32.834090+0800 SlotsKing[1743:971425] Metal API Validation Enabled
    6. -> applicationDidBecomeActive()
    7. GfxDevice: creating device client; threaded=1
    8. Initializing Metal device caps: Apple A12 GPU
    9. Initialize engine version: 2020.3.16f1 (049d6eca3c44)
    10. 2021-08-15 17:34:34.004542+0800 SlotsKing[1743:971425] Unbalanced calls to begin/end appearance transitions for <UnityViewControllerStoryboard: 0x1013450b0>.
    i've tried all the solution above,but there is no miracle~~~~
    this is my fist unity game......i hope someone can help me,thank you.
     
  17. JesterGameCraft

    JesterGameCraft

    Joined:
    Feb 26, 2013
    Posts:
    452
    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.
     
  18. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    106
    We're seeing this on 2021.3.4f1. Doesn't break anything, but it sure would be nice if it was fixed!
     
  19. Nomibuilder

    Nomibuilder

    Joined:
    Apr 24, 2014
    Posts:
    20
    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.
     
    Nikitty and ilmario like this.