Xcode 10.2.1 still happening same issue (black screen) Xcode 10.2 does

Hi,


I've started a thread https://forums.developer.apple.com/message/355767#355767 and it got lost in the limbo withou a solution.


I thought that this might be fixed in the 10.2.1 release of Xcode but it is still happening.


My project works well on the debugger 10.2 and on xcode 10.1 (debug and release) too. This looks like a Xcode 10.2 issue... only on the release build


I've just updated to 10.2.1 and still this issue continues to happen. I have to keep a copy of Xcode 10.1 to release the builds.


I've foreced a crash on didFinishLaunching to see if the app crashes and it doesn't.. it stays in the blakcscreen after the slpashscreen... so it seams that it doesn't even give back control to me...


Can the Xcode team dig deeper on this issue?


thanks

Replies

Your previous thread seems inaccsible.


So please explain again exactly the problem, detail the context (use of external framworks ?)… possibly post code.

After updating to Xcode 10.2 I released a build to testflight and it gets a black screen right after the splash screen. No crashes.


Everything works fine debugging on the Simulator.


Not a single line of code is changed and a build released on Xcode 10.1 opens fine on testflight but a build on 10.2 or 10.2.1 it gets stuck right after the splashcreen on a black screen.


Project is entirely on swift 4.2


You where the person that replied to my last thread but now it says that moderator rejected my last thread.


You said that I needed to speak with the creator of the push SDK that I was using but he said that it never happened to him.


didFinishLaunchingWithOptions doesn't get called in the release build. I forced a crash on the first line inside didFinishLaunchingWithOptions and the app doesn't crash.


here is the code:


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 
        // Override point for customization after application launch. 
        setupApp(currentApp: application) 
        FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions) 

        // Check if launched from notification 
        let notificationOption = launchOptions?[.remoteNotification] 

        if let notification = notificationOption as? [String: AnyObject], 
            let aps = notification["aps"] as? [String: AnyObject] { 

            AlliNPush.getInstance().receiveNotification(self, userInfo: ((notificationOption as! NSDictionary).object(forKey: "aps") as? NSDictionary)!) 
        } 

        return super.application(application, alliNDelegate: self, didFinishLaunchingWithOptions: launchOptions); 
    }


func setupApp(currentApp: UIApplication) {  
  
        FirebaseApp.configure()  
        OnBoardCoordinator.main.start(window)  
  
        setupNotifications(app: currentApp)  
   
        Fabric.with([Answers.self])  
   
        Analytics().setup()  
    } 


func setupNotifications(app: UIApplication) {  
  
        if #available(iOS 10.0, *) {  
            // For iOS 10 display notification (sent via APNS)  
            UNUserNotificationCenter.current().delegate = self  
         
            let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]  
            UNUserNotificationCenter.current().requestAuthorization(  
                options: authOptions,  
                completionHandler: {_, _ in })  
        } else {  
            let settings: UIUserNotificationSettings =  
                UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)  
            app.registerUserNotificationSettings(settings)  
        }  
     
        app.registerForRemoteNotifications()  
     
        Messaging.messaging().delegate = self  
    } 
func start(_ window: UIWindow?) {  
        self.window = (window == nil) ? UIWindow(frame: UIScreen.main.bounds) : window  
        self.window?.backgroundColor = Colors.shared.system.primary  
        self.window?.rootViewController = navigation  

        if let loadingVC = Storyboard.helpers.controller(to: "loadingViewController") {  
            navigation.setViewControllers([loadingVC], animated: true)  
        }  

        ConfigService.shared.loaded.subscribe(onNext: { loaded in  
            if loaded {  
                DispatchQueue.main.async {  
                    self.start()  
                }  
            }  

        }, onError: { error in  
            self.set(stage: .networkError(error))  

        }).disposed(by: DISPOSABLE_BAG)  

        self.window?.makeKeyAndVisible()  
    } 
open func application(_ application: UIApplication, alliNDelegate: AlliNDelegate, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {  
        self.alliNDelegate = alliNDelegate;  

        AlliNPush.registerForPushNotifications();  


        return true;  
    } 


AppDelegate is declared as such:

@UIApplicationMain 
class AppDelegate: AlliNResponder, AlliNDelegate {



then AlliNResponder itself is declarated as such:


open class AlliNResponder : UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

I had same issue.

I've solved like this based, in your codes

plz call "window?.makeKeyAndVisible" before "ConfigService.shared.loaded..."

I had a similar problem.


Turned out the problem was that I had followed xCode's suggestion and made "application(_ application: UIApplication, didFinishLaunchingWithOptions) ..." function private. Deleting the "private" solved the problem.

Maybe someone have similar issue, i just wanted to share.
We have @ionic/react capacitor -app and normally i did not get any error, at testFlight we get black screen, 
check config.capacitor.json and see if u have localhost there, delete URLs under server ..
we(I) forgot our URL localhost still there, to be honest i did not know that could be problem ,
i spent time(days) to check storyBoard suggestions.