Try Updating Xcode from the AppStore if any update is available. For me I was using the latest iOS version but didn't used the latest version of Xcode so it caused the problem