Status Update
Comments
as...@google.com <as...@google.com> #2
[Deleted User] <[Deleted User]> #3
as...@google.com <as...@google.com> #4
da...@gmail.com <da...@gmail.com> #5
Hi,
We are also experiencing this crash using Google Maps SDK 3.8.0 for iOS. We recently released a BETA version of our app with TestFlight and users are reporting severe crashes happening since when we included the map in the main view controller of our app. We identified the crash issue with Firebase and by performing a quick search of the problem it appears we are not the only one experiencing it: We are using Objective-C in our app, and while I cannot share the full code of the view controller due to company policies, this is how we are creating the map in our code:
_mapView = [GMSMapView new];
_mapView.delegate = self;
_mapView.myLocationEnabled = NO;
_mapView.mapType = kGMSTypeNormal;
_mapView.settings.scrollGestures = NO;
_mapView.settings.zoomGestures = NO;
_mapView.settings.tiltGestures = NO;
_mapView.settings.rotateGestures = NO;
_mapView.settings.compassButton = NO;
_mapView.settings.myLocationButton = NO;
_mapView.translatesAutoresizingMaskIntoConstraints = NO;
The GMSMapView
is the attached to the UIViewController
view using Autolayout constraints. We are also performing any sort of resources cleanup, like removing the map when the view controller view is not visibile anymore (viewWillDisappear:
) and when the application resign active. Everything is configured inside the viewWillAppear:
.
We also were not able to reproduce the issue on our end, although our BETA testers are reporting the crashes to happen quite frequently. This is the stacktrace of the crash logged on Firebase:
Crashed: com.apple.main-thread
0 appname 0x1016b697c gmscore::renderer::GLState::Flush() + 17080
1 appname 0x1016c1ce4 gmscore::renderer::GLScopedContext::~GLScopedContext() + 31628
2 appname 0x101724c10 -[GMSEntityRendererView setFrame:] + 436920
3 appname 0x10176d500 -[GMSVectorMapView setFrame:] + 185672
4 UIKitCore 0x18ac19168 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 600
5 UIKitCore 0x18ac19e28 -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 240
6 CoreFoundation 0x1865f04e0 __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 24
7 CoreFoundation 0x1864ee084 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 432
8 UIKitCore 0x18ac18ebc -[UIView(Geometry) resizeSubviewsWithOldSize:] + 172
9 UIKitCore 0x18ac1a158 -[UIView(Geometry) setBounds:] + 704
10 UIKitCore 0x18ac19a00 -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 532
11 UIKitCore 0x18ac19dc4 -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 140
12 CoreFoundation 0x1865f04e0 __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 24
13 CoreFoundation 0x1864ee084 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 432
14 UIKitCore 0x18ac18ebc -[UIView(Geometry) resizeSubviewsWithOldSize:] + 172
15 UIKitCore 0x18ab5b580 -[UIView(AdditionalLayoutSupport) _is_layout] + 152
16 UIKitCore 0x18ac20ce8 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 1056
17 UIKitCore 0x18ac346a0 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2168
18 QuartzCore 0x18d2874a0 -[CALayer layoutSublayers] + 292
19 QuartzCore 0x18d2878e0 CA::Layer::layout_if_needed(CA::Transaction*) + 472
20 QuartzCore 0x18d299dc4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 144
21 QuartzCore 0x18d1de884 CA::Context::commit_transaction(CA::Transaction*, double) + 304
22 QuartzCore 0x18d2093d0 CA::Transaction::commit() + 656
23 UIKitCore 0x18a760d80 _UIApplicationFlushRunLoopCATransactionIfTooLate + 116
24 UIKitCore 0x18a806d0c __handleEventQueueInternal + 6120
25 UIKitCore 0x18a7fec88 __handleHIDEventFetcherDrain + 144
26 CoreFoundation 0x186599860 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
27 CoreFoundation 0x1865997b4 __CFRunLoopDoSource0 + 84
28 CoreFoundation 0x186598f68 __CFRunLoopDoSources0 + 296
29 CoreFoundation 0x186593ca4 __CFRunLoopRun + 796
30 CoreFoundation 0x186593660 CFRunLoopRunSpecific + 480
31 GraphicsServices 0x1909a4604 GSEventRunModal + 164
32 UIKitCore 0x18a76815c UIApplicationMain + 1944
33 appname 0x100a8019c main + 16 (main.m:16)
34 libdyld.dylib 0x18640f1ec start + 4
Also, while firebase reports the crashes to happen then the app is in Foreground, our BETA testers are reporting the crashes to happen while the app is in background (or woken up from background), which is quite odd since are removing the map from the viewport when the app goes in background mode:
[self.mapView removeFromSuperview];
[self.mapView clear];
self.mapView = nil;
I'm also attaching a screenshot of the crash count reported on Firebase to give you a general idea of the impact of the crashes in our app. I'll be happy to provide more data to help you address this issue.
da...@gmail.com <da...@gmail.com> #6
We downgraded to version 3.7.0 and the issue seems to be gone (even though in the release notes of version 3.8.0 it's mentioned no changes)
[Deleted User] <[Deleted User]> #7
dj...@gmail.com <dj...@gmail.com> #8
I applied one of the workarounds mentioned in that issue, and I upgraded the SDK to the latest version (to be on the same page). But now we are having this new issue.
Description
We are receiving crash reports on crashlytics.
Crashed: com.apple.main-thread
0 TheBarCode 0x1025fc2d8 gmscore::renderer::GLState::Flush() + 16388
1 TheBarCode 0x102607630 gmscore::renderer::GLScopedContext::~GLScopedContext() + 31600
2 TheBarCode 0x10266a314 -[GMSEntityRendererView setFrame:] + 436308
3 TheBarCode 0x1026b2578 -[GMSVectorMapView setFrame:] + 184912
4 UIKitCore 0x18502b878 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 576
5 UIKitCore 0x18502c510 -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 236
6 CoreFoundation 0x180afd95c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16
7 CoreFoundation 0x180a00fb0 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 416
8 UIKitCore 0x18502b5e4 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156
9 UIKitCore 0x18502c82c -[UIView(Geometry) setBounds:] + 688
10 UIKitCore 0x18502c0e0 -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 528
11 UIKitCore 0x18502c4ac -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 136
12 CoreFoundation 0x180afd95c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16
13 CoreFoundation 0x180a00fb0 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 416
14 UIKitCore 0x18502b5e4 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156
15 UIKitCore 0x184f736fc -[UIView(AdditionalLayoutSupport) _is_layout] + 148
16 UIKitCore 0x185033090 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 1032
17 Gradientable 0x1034e8798 UIView.swizzled_layoutSubviews() + 50 (Gradientable.swift:50)
18 Gradientable 0x1034e88d0 @objc UIView.swizzled_layoutSubviews() + 4326508752 (<compiler-generated>:4326508752)
19 UIKitCore 0x18504617c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2140
20 QuartzCore 0x1875ae2c0 -[CALayer layoutSublayers] + 284
21 QuartzCore 0x1875b443c CA::Layer::layout_if_needed(CA::Transaction*) + 480
22 QuartzCore 0x1875bf140 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136
23 QuartzCore 0x187507884 CA::Context::commit_transaction(CA::Transaction*, double) + 304
24 QuartzCore 0x187531574 CA::Transaction::commit() + 676
25 QuartzCore 0x187531f68 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
26 CoreFoundation 0x180aa7e68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
27 CoreFoundation 0x180aa2d54 __CFRunLoopDoObservers + 416
28 CoreFoundation 0x180aa3320 __CFRunLoopRun + 1308
29 CoreFoundation 0x180aa2adc CFRunLoopRunSpecific + 464
30 GraphicsServices 0x18aa43328 GSEventRunModal + 104
31 UIKitCore 0x184bb063c UIApplicationMain + 1936
32 TheBarCode 0x10215756c main + 21 (Preference.swift:21)
33 libdyld.dylib 0x18092c360 start + 4
What should happen instead?
App should not crash.
Steps to reproduce the problem:
This crashing issue is not reproduceable on our devices and simulator. We have checked on iPhone 8, iPhone 7 running iOS 13.3.1
Operating system version: 13.3.1 (17D50)
Google Maps SDK for iOS version: 3.8.0 (Cocoapods version)
Hardware model: iPhone 11 pro, iPhone 7 plus...
-------------------------------------------------------------------
Additional Information:
Recently we have upgraded our application for iOS 13 and xcode 11. By doing so, we have also updated google maps iOS SDK to 3.8.0. After upgrading we are receiving crash reports. On the previously used version we never experienced this crash i.e. 2.7.0
In our application we have multiple instances of GMSMapView i.e. around 8 instances embedded in a UIPageViewController. For the sake of memory management we only keep the visible version of GMSMapView and discard other instances in viewDidDisappear method of view controller. Here is the code that we are using to setup map and clearing map.
func setupMapView() {
let mapView = GMSMapView(frame: CGRect.zero)
mapView.settings.allowScrollGesturesDuringRotateOrZoom = false
if CLLocationManager.authorizationStatus() != .notDetermined {
mapView.settings.myLocationButton = false
mapView.isMyLocationEnabled = true
self.myLocationButtonContainer.isHidden = false
} else {
self.myLocationButtonContainer.isHidden = true
}
self.mapContainer.insertSubview(mapView, at: 0)
mapView.autoPinEdgesToSuperviewEdges()
let iconGenerator = GMUCustomClusterIconGenerator()
let algorithm = GMUNonHierarchicalDistanceBasedAlgorithm()
let renderer = GMUDefaultClusterRenderer(mapView: mapView, clusterIconGenerator: iconGenerator)
renderer.delegate = self
self.clusterManager = GMUClusterManager(map: mapView, algorithm: algorithm, renderer: renderer)
self.clusterManager?.setDelegate(self, mapDelegate: self)
self.mapView = mapView
self.setUpMarkers()
self.restoreMapCameraPosition(animated: false)
}
func clearMapView() {
self.clusterManager?.clearItems()
self.mapView?.clear()
self.mapView?.removeFromSuperview()
self.mapView = nil
self.clusterManager = nil
}
The other strange thing is that we are not receiving any additional added (on which screen does it happen) logs along with the crash.