I have face this problem many time while converting various projects to Swift3.0.
As this issue looks dynamic, every one has its own solution other then any universal answer.
But in this issue main problem is to identify spot to get work on.
So What I am following is as below:

In my case AppDelegate is responsible.
To find line of error, go to end of long error description.You will find code something like below:
1. While emitting IR SIL function @_TFC9MyProject11AppDelegate21getNotificationDetailfGSqGVs10DictionaryVs11AnyHashableP___T_ for 'getNotificationDetail' at /Users/ABC/Documents/BitBucket/iOS/2016/Projects/MyProject/AppDelegate/AppDelegate.swift:153:5
Here 153
is line of code in AppDelegate.swift
.
func getNotificationDetail(_ launchOptions : [AnyHashable: Any]?) {
if launchOptions != nil {
let dictLaunch = launchOptions! as NSDictionary
NotificationCenter.default.addObserver(self, selector: #selector(AppDelegate.openRespectiveNotificationScreen), name: NSNotification.Name(rawValue: WebServiceKey.APPMANAGER_SERVICE_CALL_FINISH), object: nil)
inactiveUserInfo = dictLaunch.object(forKey: UIApplicationLaunchOptionsKey.remoteNotification) as? NSDictionary
}
}
Then comment all the code inside method and build again. Then try uncomment one by one line ,so you finally get line which generates error.
After finding exact line of code, you can easily fix it.
In my code i find last line of this method generate error.
So i replace it with below code and it build get successfully.
inactiveUserInfo = dictLaunch[UIApplicationLaunchOptionsKey.remoteNotification] as? NSDictionary
So main thing is to debug cautiously.
Try this way, you will definitely solve error easily.