When you were trying to use Location Service to get user’s current location. Even it already popped up a dialog to grant Location permission, you could not get the location and saw error message by
locationManager(_:didFailWithError:) Error Domain=kCLErrorDomain Code=1 "(null)"
The way to fix it is very simple. Just launch System Setting, go to Privacy and Security and Location Services. Then, switch on for your app. It is done. You don’t need to relaunch your app, it will be updated again by itself.
Additional
If you are working on testing your app on iOS/iPad Simulator, you can choose one of built-in location for the simulation or input your lat/lon manually.