mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

CoreLocation - This method can cause UI unresponsiveness

Open jhoanarango opened this issue 2 years ago • 8 comments

Environment

  • Xcode version: Beta 3
  • iOS version: 16
  • Devices affected:
  • Maps SDK Version: 10.6.0

Observed behavior and steps to reproduce

Behavior normal, but get a warning from the console.

"/Users/distiller/project/Sources/MapboxMobileEvents/MMEEventsManager.m:356: warning run: This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the -locationManagerDidChangeAuthorization: callback and checking authorizationStatus first."

Additional links and references

See Image Below

Screen Shot 2022-07-08 at 3 06 05 PM

jhoanarango avatar Jul 08 '22 19:07 jhoanarango

@jhoanarango, can you provide additional information/ a code snippet of what is happening in your code when you receive that message?

ZiZasaurus avatar Aug 18 '22 15:08 ZiZasaurus

Hello,

So there is not code snippet that I can't point to from my code, however following this trace it leads me to MapBox's EventsManager.sendTurnstile(). I will post screenshots here, since it seems is the best way to show you. Also, I am on XCode Beta 5 now.

Screen Shot 2022-08-18 at 11 53 32 AM

jhoanarango avatar Aug 18 '22 15:08 jhoanarango

@jhoanarango Were you able to find a fix for it? I'm seeing the exact same thing as you. CC: ZiZasaurus

srinivaskasala avatar Aug 22 '22 22:08 srinivaskasala

@srinivaskasala , hey sorry I didn't answer earlier. But not, till this day I have not been able to do anything about this. I think this is more on the MapBox side. They should take a look since I do not have access.

jhoanarango avatar Sep 07 '22 01:09 jhoanarango

@jhoanarango @srinivaskasala Here is the PR with the fix: https://github.com/mapbox/mapbox-events-ios/pull/344 It was released as part of MapsSDK 10.8. There are some cases when you still can see this issue but I can assure you that aside from the Xcode warning, this problem has no impact on the stability of the SDK. It was blocking the main thread for a small amount of time, but it happens only during the MapView initialization as you can see from the stack trace, so it doesn't affect the map after it has been created.

azarovalex avatar Sep 09 '22 15:09 azarovalex

@azarovalex, thank you for the update. Will update to the latest SDK.

jhoanarango avatar Sep 09 '22 19:09 jhoanarango

I am running 10.8.1 with iOS 16 and I get this warning every time the MapView initializes.

Surferdude667 avatar Oct 03 '22 18:10 Surferdude667

Same issue on my side with 10.8.1:

Screen Shot 2022-10-17 at 09 23 34

Adraesh avatar Oct 17 '22 07:10 Adraesh

Hi, I observe the same runtime warning as @Adraesh on 10.8.1.

199822839-c8d5a280-4193-45f9-929e-dfc57b222988

pradeeplobo86 avatar Nov 03 '22 20:11 pradeeplobo86

This warning is addressed in v10.9.0.

evil159 avatar Nov 30 '22 07:11 evil159

I AM GETTING THE SAME ERROR, WHY DID YOU CLOSE THE ISSUE???

fatihmerickoc avatar Jul 25 '23 21:07 fatihmerickoc