4

I have a fresh iOS app / project; all I've done is import the HomeKit framework. When I instantiate HMHomeManager:

var homeManager = HMHomeManager()

Xcode yells at me:

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

... this occurs even if I wrap it in DispatchQueue.main.async {}

Since this project is effectively blank, I'm assuming this an Xcode bug ... but am I doing something wrong?

Dan
  • 4,197
  • 6
  • 34
  • 52
  • Can you show more context? Where are you instantiating the `HMHomeManager`? Which version of iOS and Xcode are you using? I just created a blank single view application in Xcode and instantiated a `HMHomeManager` both as a property with a default value and in `viewDidLoad` and did not have any warnings on background thread. – Paulw11 Nov 14 '18 at 00:10
  • @Paulw11 Xcode version 10.1 (10B61) ... iOS 12.1 (16B92) ... doing exactly the same thing you are. – Dan Nov 14 '18 at 00:32
  • Hmm. I am running the same versions. I tested on an iPhone 8+ and an iPhone XR simulator. No issues. Can you upload your test project somewhere? – Paulw11 Nov 14 '18 at 00:35
  • Did you ever resolve this? I am having the same issue. Xcode 10.2, iOS 12.2. – mark Apr 03 '19 at 13:13
  • @mark negative -- upvote the question and maybe we'll get an answer some day :/ – Dan Apr 03 '19 at 21:29
  • 2
    The backtrace I get ends up in CoreLocation CLClientStopVehicleHeadingUpdates, called from HomeKit . – mark Apr 05 '19 at 00:20
  • Has anyone come up with the solution? I'm facing the same issue... – Nikita Zernov Aug 05 '19 at 07:47
  • I have the same issue, happens on iPhone XS with iOS 12.4. I tried the same app on iPhone 5s with iOS 12.3.1 and there is no such warning. I guess we should ignore it and wait until it's fixed. – philips77 Aug 07 '19 at 12:28

0 Answers0