googlemaps / ios-on-demand-rides-deliveries-samples

Apache License 2.0
17 stars 10 forks source link

Crash with UIKit #17

Open WaiLynnZaw opened 1 year ago

WaiLynnZaw commented 1 year ago

Environment details

GMTCMapView init cause crash. OS - 16.4 iOS Simulator, using UIKit SDK Version - 1.0.6, 2.2.0

Initialize like that and cause crash.

class ViewController: UIViewController, GMTCMapViewDelegate {
  private var rideSharingMap: GMTCMapView?

  override func viewDidLoad() {
    super.viewDidLoad()

    self.rideSharingMap = GMTCMapView(frame: UIScreen.main.bounds)
    self.rideSharingMap.delegate = self
    self.rideSharingMap?.settings.myLocationButton = true
    self.view.addSubview(self.rideSharingMap!)
    ...
  }

Stacktrace

 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Have you sent -setElevation:forState: to <GMSx_MDCFloatingButton: 0x7f7b68565a00; baseClass = UIButton; frame = (-66 -66; 56 56); alpha = 0; hidden = YES; opaque = NO; autoresize = LM+TM; userInteractionEnabled = NO; backgroundColor = UIExtendedGrayColorSpace 1 1; layer = <GMSx_MDCShapedShadowLayer: 0x6000032a9d80>> off the main thread? To verify, look for a complaint in the logs: "Unsupported use of UIKit…", and fix the problem if you find it. If your use is main-thread only please file a radar on UIKit, and attach this log. exercisedImplementations = {
    "setElevation:forState:" =     (
    );
}'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000122a5978b __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x0000000115fe9b73 objc_exception_throw + 48
    2   Foundation                          0x00000001191ff109 -[NSMutableDictionary(NSMutableDictionary) classForCoder] + 0
    3   UIKitCore                           0x0000000147456f8b PushNextClassForSettingIMP + 612
    4   UIKitCore                           0x000000014745fa38 __workaround10030904InvokeWithTarget_block_invoke + 26
    5   UIKitCore                           0x00000001480233f5 +[UIView _performSystemAppearanceModifications:] + 56
    6   UIKitCore                           0x0000000147459dd8 applyInvocationsToTarget + 1487
    7   UIKitCore                           0x0000000147459047 +[_UIAppearance _applyInvocationsTo:window:matchingSelector:onlySystemInvocations:] + 1809
    8   UIKitCore                           0x0000000148051f57 __88-[UIView(Internal) _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:]_block_invoke + 62
    9   UIKitCore                           0x0000000148051ed0 -[UIView _performUpdatesForPossibleChangesOfIdiom:orScreen:traverseHierarchy:] + 200
    10  UIKitCore                           0x0000000147166446 -[UIButton _didChangeFromIdiom:onScreen:traverseHierarchy:] + 85
    11  UIKitCore                           0x0000000148051719 -[UIView _didChangeFromIdiomOnScreen:traverseHierarchy:] + 174
    12  UIKitCore                           0x00000001480512c5 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1932
    13  UIKitCore                           0x0000000147172ae0 -[UIControl _didMoveFromWindow:toWindow:] + 47
    14  UIKitCore                           0x0000000147168cd7 -[UIButton _didMoveFromWindow:toWindow:] + 82
    15  UIKitCore                           0x0000000148050f70 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1079
    16  UIKitCore                           0x0000000148050f70 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1079
    17  UIKitCore                           0x0000000148050f70 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 1079
    18  UIKitCore                           0x0000000148044059 __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 130
    19  CoreAutoLayout                      0x000000012349f572 -[NSISEngine withBehaviors:performModifications:] + 84
    20  UIKitCore                           0x0000000148043f76 -[UIView _postMovedFromSuperview:] + 833
    21  UIKitCore                           0x0000000148053efb -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2839
    22  TestApp                                0x00000001324949ec $s4TestApp13ViewControllerC11viewDidLoadyyFyyScMYccfU_ + 252
    23  TestApp                                0x0000000132084fa8 $sIeg_IeyB_TR + 40
    24  libdispatch.dylib                   0x000000012128a54f _dispatch_call_block_and_release + 12
    25  libdispatch.dylib                   0x000000012128b7ec _dispatch_client_callout + 8
    26  libdispatch.dylib                   0x000000012129c6e2 _dispatch_main_queue_drain + 1462
    27  libdispatch.dylib                   0x000000012129c11e _dispatch_main_queue_callback_4CF + 31
    28  CoreFoundation                      0x00000001229b76cc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    29  CoreFoundation                      0x00000001229b1fbe __CFRunLoopRun + 2429
    30  CoreFoundation                      0x00000001229b1264 CFRunLoopRunSpecific + 560
    31  GraphicsServices                    0x000000013a85a24e GSEventRunModal + 139
    32  UIKitCore                           0x0000000147a1f7bf -[UIApplication _run] + 994
    33  UIKitCore                           0x0000000147a245de UIApplicationMain + 123
    34  TestApp.                        0x0000000104ede15f main + 63
    35  dyld                                0x000000010f976384 start_sim + 10
    36  ???                                 0x000000020772541f 0x0 + 8714867743
)
wangela commented 1 year ago

If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.

@WaiLynnZaw Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.