Search code examples
iosxcodeios15xcode13

White Screen Shows for Minutes Before Launching App - Xcode 13 on iOS 15.1.1


This is a weird bug I'm getting using Xcode 13 and iOS 15.1.1. I've developed a simple app and when I run the app on iOS 15.1.1 (iPhone 13 Pro), before the app launches a white screen (black in case dark mode is ON), is shown, for couple of minutes.

Does anyone know a work around this? This completely disrupts the development process and breaks the flow while testing the app. Build time is within a minute and you have to wait extra time for the white screen to go away.

I've tried the following solutions but it didn't work

  1. Removing iOS DeviceSupport and restarting Xcode

rm -r ~/Library/Developer/Xcode/iOS\ DeviceSupport


Edit 1: This is happening only when run button from Xcode is pressed and after it once launches from Xcode and then I close the app and start again from phone it works normal

Deleting DerivedData too did not work

Some code to give reference:

AppDelegate.swift

import UIKit
import Firebase

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    // MARK: - didFinishLaunchingWithOptions
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
                   
        let storyboard =  UIStoryboard(name: "Main", bundle: nil)
        self.window?.rootViewController = storyboard.instantiateInitialViewController()
        self.window?.makeKeyAndVisible()
        
        
        FirebaseApp.configure()
        
        return true
    }

    // MARK: -
    
    // MARK: UISceneSession Lifecycle

    func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
        // Called when a new scene session is being created.
        // Use this method to select a configuration to create the new scene with.
        return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
    }

    // MARK: - didDiscardSceneSessions
    
    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
        // Called when the user discards a scene session.
        // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
        // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
    }

    

}

Root VC:

import UIKit

class VC_AppleSignIn: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        print("Hello World!")
    }

}

enter image description here

Please let me know if any other code is required!


Solution

  • The issue finally resolved. I updated my Xcode to 13.2 and it fixed it. Not sure what was causing it. But it's fixed with the new Xcode update