let config = Realm.Configuration(
// Set the new schema version. This must be greater than the previously used
// version (if you\'ve never set a
Make sure you don't try to instantiate instance of Realm() before migration config is set in application(application:didFinishLaunchingWithOptions:)
. When it crashes check execution stack to find which instance raised exception. I had the same error, in my case Realm instance in one of my view controllers were instantiated before migration block was set.
Good luck