Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Crash in setUserLocationVerticalAlignment #5274

Closed

Description

@picciano

Platform: iOS
Mapbox SDK version: ios-v3.2.2 (abe1695)

Steps to trigger behavior

  1. Launch app with map
  2. In viewWillAppear call [self.mapView setUserLocationVerticalAlignment:MGLAnnotationVerticalAlignmentCenter animated:NO];

Expected behavior

App does not crash.

Actual behavior

App occasionally crashes. I think an array of locations is being created at line 3899 and self.userLocation.location is nil.
[self locationManager:self.locationManager didUpdateLocations:@[self.userLocation.location] animated:animated];

Stack trace

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x18385adb0 __exceptionPreprocess
1  libobjc.A.dylib                0x182ebff80 objc_exception_throw
2  CoreFoundation                 0x18373e1a0 -[__NSPlaceholderArray initWithObjects:count:]
3  CoreFoundation                 0x183749c48 +[NSArray arrayWithObjects:count:]
4  Mapbox                         0x100621560 -[MGLMapView setUserLocationVerticalAlignment:animated:]
5  TallyGo                        0x100188530 -[TGMainViewController viewWillAppear:] (TGMainViewController.m:194)
6  UIKit                          0x1889d1374 -[UIViewController _setViewAppearState:isAnimating:]
7  UIKit                          0x1889d10e8 -[UIViewController __viewWillAppear:]
8  UIKit                          0x188b6be5c -[UINavigationController _startCustomTransition:]
9  UIKit                          0x188a77e40 -[UINavigationController _startDeferredTransitionIfNeeded:]
10 UIKit                          0x188a77b1c -[UINavigationController __viewWillLayoutSubviews]
11 UIKit                          0x188a77a84 -[UILayoutContainerView layoutSubviews]
12 UIKit                          0x1889b41e4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
13 QuartzCore                     0x186346994 -[CALayer layoutSublayers]
14 QuartzCore                     0x1863415d0 CA::Layer::layout_if_needed(CA::Transaction*)
15 QuartzCore                     0x186341490 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
16 QuartzCore                     0x186340ac0 CA::Context::commit_transaction(CA::Transaction*)
17 QuartzCore                     0x186340820 CA::Transaction::commit()
18 QuartzCore                     0x186339de4 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
19 CoreFoundation                 0x183810728 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
20 CoreFoundation                 0x18380e4cc __CFRunLoopDoObservers
21 CoreFoundation                 0x18380e8fc __CFRunLoopRun
22 CoreFoundation                 0x183738c50 CFRunLoopRunSpecific
23 GraphicsServices               0x185020088 GSEventRunModal
24 UIKit                          0x188a22088 UIApplicationMain
25 TallyGo                        0x1001876c4 main (main.m:14)
26 libdispatch.dylib              0x1832d68b8 (Missing)

Activity

  1. added
    iOS
    on Jun 7, 2016
  2. added a commit that references this issue on Jun 7, 2016
    c9ee578
  3. added a commit that references this issue on Jun 7, 2016
    e503f92
  4. added this to the ios-v3.3.0 milestone on Jun 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashiOS

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions