MonitoringError

I am facing this issue when i start monitoring

error The operation couldn’t be completed. (DeviceActivity.DeviceActivityCenter.MonitoringError error 0.)

source code

in didFinishLaunchingWithOptions

center.requestAuthorization{ result in     print(result)       switch result {       case .success():         print("success")                   switch self.center.authorizationStatus {         case .approved:           print("approved")                       let center = DeviceActivityCenter()           do {             try center.startMonitoring(.daily, during: self.schedule)           } catch {             print("error (error.localizedDescription)")           }            case .denied:           print("denied")         case .notDetermined:           print("not determined")         }       case .failure(let error):         print(error.localizedDescription)                 }     }

MonitoringError
 
 
Q