3

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!

Arjun
  • 1,477
  • 1
  • 13
  • 23
  • 1
    Share some code. Did you test your project on a lower iOS version? – Rashed Dec 12 '21 at 18:47
  • 1
    I suggest you try deleting DerivedData and make a clean build. Also some code sharing would help – Bezaleel Dec 13 '21 at 09:12
  • 2
    If you don't give more information, no one can help you and you're just throwing away 50 points of rep. Try to understand: nobody else is seeing this problem. So you have to _help us see it_ if you want us to help _you_. It sounds like perhaps you are doing a lot of work on the main thread during launch, which is always wrong behavior. Use Instruments to find out what's happening. – matt Dec 14 '21 at 13:05
  • I will edit the question to add the code, since I create a fresh project with nothing in it and it is working absolutely fine. So the bug's in my code I guess. I'll update the question – Arjun Dec 15 '21 at 04:19
  • There is a similar problem here but none of their solution is working: https://stackoverflow.com/questions/69576384/xcode-debug-on-ios15-blank-white-screen-and-minutes-delay-before-app-starts – Arjun Dec 15 '21 at 06:16

1 Answers1

0

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

Arjun
  • 1,477
  • 1
  • 13
  • 23