After migration of Xcode to 10, an iOS project - which was building and running perfectly on previous Xcode 9 - is crashing during compilation with "Segmentation fault 11"
I did upgrade my MacOS to Mojave, but the issue is still there.
I get the following error:
While emitting SIL for 'application(_:didRegisterForRemoteNotificationsWithDeviceToken:)' at
/Users/swanandpatil/Desktop/omerApp/CustomerApp/AppDelegate.swift:955:5
- While silgen emitFunction SIL function "@$S17CustomerApp0C8DelegateC11application_48didRegisterForRemoteNotifications WithDeviceTokenySo13UIApplicationC_10Foundation4DataVtF". for 'application(_:didRegisterForRemoteNotificationsWithDeviceToken:)' at /Users/swanandpatil/Desktop/RSA247CustomerApp/RSA247CustomerApp/AppDelegate.swift:955:5 error: Segmentation fault: 11
Below is my code:
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
//print("deviceToken is \(deviceToken)");
if let token = InstanceID.instanceID().token() {
UserDefaults.standard.set(token, forKey:"fcm_tokenNew")
let token2 = UserDefaults.standard.object(forKey:"fcm_tokenNew") as? String
print("FCM TOKEN2 IS\(describing: token2 )");
}
}