作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
根据 crashlytics 的报告,我们的应用程序发生了很多用户崩溃的情况,但我们无法在我们这边重现这些崩溃。这是完整的崩溃报告:
Crashed: com.apple.main-thread
0 TheBarCode 0x100ccc2d8 gmscore::renderer::GLState::Flush() + 16388
1 TheBarCode 0x100cd7630 gmscore::renderer::GLScopedContext::~GLScopedContext() + 31600
2 TheBarCode 0x100d3a314 -[GMSEntityRendererView setFrame:] + 436308
3 TheBarCode 0x100d82578 -[GMSVectorMapView setFrame:] + 184912
4 UIKitCore 0x18f6af878 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 576
5 UIKitCore 0x18f6b0510 -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 236
6 CoreFoundation 0x18b18195c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16
7 CoreFoundation 0x18b084fb0 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 416
8 UIKitCore 0x18f6af5e4 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156
9 UIKitCore 0x18f6b082c -[UIView(Geometry) setBounds:] + 688
10 UIKitCore 0x18f6b00e0 -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] + 528
11 UIKitCore 0x18f6b04ac -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 136
12 CoreFoundation 0x18b18195c __NSARRAY_IS_CALLING_OUT_TO_A_BLOCK__ + 16
13 CoreFoundation 0x18b084fb0 -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 416
14 UIKitCore 0x18f6af5e4 -[UIView(Geometry) resizeSubviewsWithOldSize:] + 156
15 UIKitCore 0x18f5f76fc -[UIView(AdditionalLayoutSupport) _is_layout] + 148
16 UIKitCore 0x18f6b7090 -[UIView(Hierarchy) _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 1032
17 Gradientable 0x101738798 UIView.swizzled_layoutSubviews() + 50 (Gradientable.swift:50)
18 Gradientable 0x1017388d0 @objc UIView.swizzled_layoutSubviews() + 4359784656 (<compiler-generated>:4359784656)
19 UIKitCore 0x18f6ca17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2140
20 QuartzCore 0x191c322c0 -[CALayer layoutSublayers] + 284
21 QuartzCore 0x191c3843c CA::Layer::layout_if_needed(CA::Transaction*) + 480
22 QuartzCore 0x191c43140 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136
23 QuartzCore 0x191b8b884 CA::Context::commit_transaction(CA::Transaction*, double) + 304
24 QuartzCore 0x191bb5574 CA::Transaction::commit() + 676
25 QuartzCore 0x191bb5f68 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
26 CoreFoundation 0x18b12be68 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
27 CoreFoundation 0x18b126d54 __CFRunLoopDoObservers + 416
28 CoreFoundation 0x18b127320 __CFRunLoopRun + 1308
29 CoreFoundation 0x18b126adc CFRunLoopRunSpecific + 464
30 GraphicsServices 0x1950c7328 GSEventRunModal + 104
31 UIKitCore 0x18f23463c UIApplicationMain + 1936
32 TheBarCode 0x10082756c main + 21 (Preference.swift:21)
33 libdyld.dylib 0x18afb0360 start + 4
另一个奇怪的事情是,我们没有收到任何额外添加的(发生在哪个屏幕上的)崩溃日志。
最近我们升级了 iOS 13 和 xcode 11 的应用程序。通过这样做,我们还将谷歌地图 iOS SDK 更新到了 3.8.0。升级后我们收到崩溃报告。在之前使用的版本中,我们从未遇到过这种崩溃,即 2.7.0
在我们的应用程序中,我们有多个 GMSMapView
实例,即嵌入 UIPageViewController
中的大约 8 个实例。为了内存管理,我们只保留 GMSMapView
的可见版本,并在 View Controller 的 viewDidDisappear
方法中丢弃其他实例。这是我们用来设置 map 和清除 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
}
来自 crashlytics 的屏幕截图:
crashlytics 数据选项卡的屏幕截图:
最佳答案
只需降级到 3.7.0 iOS Maps SDK。
pod 'GoogleMaps', '~> 3.7.0'
关于ios - Crashlytics 围绕 Maps SDK、gmscore::renderer::GLState::Flush() 的崩溃报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60826254/
根据 crashlytics 的报告,我们的应用程序发生了很多用户崩溃的情况,但我们无法在我们这边重现这些崩溃。这是完整的崩溃报告: Crashed: com.apple.main-threa
我是一名优秀的程序员,十分优秀!