Info.plist configuration "(no name)" for UIWindowSceneSessionRoleApplication
Asked Answered
D

4

7

I am getting the below warning and the app shows a black screen for iOS 13

[SceneConfiguration] Info.plist configuration "(no name)" for UIWindowSceneSessionRoleApplication contained UISceneDelegateClassName key, but could not load class with name MyApp.SceneDelegate.

How can I resolve this issue?

Deadfall answered 28/2, 2020 at 4:5 Comment(3)
Would you please try to add this in AppDelegate var window: UIWindow??Loran
I have already added it but did not work.Deadfall
So strange, I actually get the same error on Xcode 11.4.1 when I open a new project (single view, storyboard) and use an Umlaut (e.g. 'ü') in the app's name.Selectivity
W
10

SceneDelegate has supported after iOS 13. If you want to use SceneDelegate and also want to support iOS prior to iOS 13 then you have to do some changes in your project.

Execute SceneDelegate if iOS 13 available.

Code:

@available(iOS 13.0, *)

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
   //Other code
}


@available(iOS 13.0, *)
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {

}

Add UIWindow object in AppDelegate.swift

class AppDelegate: UIResponder, UIApplicationDelegate {    
    var window: UIWindow?
}

For iOS 12 and earlier

AppDelegate needs a UIWindow property. iOS 13 uses SceneDelegate in new projects. Specify the UIWindow object and remove the SceneDelegate.swift file.

If you have removed the SceneDelegate from the project, then you must remove the Application Scene Manifest dictionary from Info.plist.

Whitelivered answered 28/2, 2020 at 5:17 Comment(0)
R
10

If there are no custom scene used other than Default one, remove 'UISceneClassName' from Info.plist.

<key>UISceneClassName</key>
<string></string>
Raglan answered 12/11, 2020 at 12:43 Comment(1)
This answer was my solution when trying to add UIKit to SwiftUI project in Xcode 13.2.1 mokacoding.com/blog/…Acclamation
M
2

Remove these lines in Info.plist:

<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
Margetmargette answered 1/5, 2023 at 12:26 Comment(0)
J
2

For some pure SwiftUI projects you could just delete everything under Scene Configuration in Info.plist to make it empty like on the screenshot enter image description here

Justiciary answered 15/3, 2024 at 11:49 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.