首页 > 解决方案 > I/Counters: exceeded sample count in FrameTime log

问题描述

I recently started to see this logs I/Counters: exceeded sample count in FrameTime multiple times in my app logcat, I understood it comes from Google Maps.

Any idea what it means? and how to get rid of it?

标签: androidgoogle-mapsgoogle-maps-api-3

解决方案


尝试禁用小部件的几层(例如使用“myLocationEnabled”参数启用的“myLocation”层)并在发布版本中重新启用它们。还要确保你在 dispose 方法中处理你的谷歌地图控制器(如果你在从 onMapCreated 获取它之后将它存储在某个地方)。

据我从错误和 API 文档中可以看出,GoogleMaps 有多个图层,每个图层都需要在给定的 FrameTime 中构建。由于多层的额外负担减慢了处理速度,它可能会超过给定的 FrameTime 并触发错误。

原因还可能包括调试版本没有优化并且确实影响 GoogleMaps 包的事实。我尝试了相同的应用程序,在真实设备上的发布版本中不断出现“I/Counters:FrameTime 中的样本计数超出”错误,并且错误似乎没有出现,这意味着这些错误可以简单地忽略。


推荐阅读