I/Counters: exceeded sample count in FrameTime log
AndroidGoogle MapsGoogle Maps-Api-3Android Problem Overview
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?
Android Solutions
Solution 1 - Android
Try disabling a few layers of the widget (like say 'myLocation' layer enabled by using 'myLocationEnabled' parameter) and enable them back in the release build. Also make sure you are disposing your Google Maps Controller in the dispose method (if you are storing it somewhere after taking it from onMapCreated).
As far as I can figure out from the error and the API docs, GoogleMaps has multiple layers and each layer needs to be built in a given FrameTime. Since the added burden of multiple layers slow down the processing, it may exceed given FrameTime and trigger the error.
The reason may also include the fact that debug builds have no optimisations and that really affects the GoogleMaps package. I tried the same app with the constant barrage of 'I/Counters: exceeded sample count in FrameTime' errors in release build on a real device and the errors seem to not appear, implying these errors can simply be ignored.
Solution 2 - Android
I had the same issue since this morning, it was gone when after I:
- stopped my emulator
- wiped the data
- cold booted it.
NOTE: this is with android
Solution 3 - Android
For Android emulators it's enough to wipe the data of the device and the FrameTime
messages will go away.
EDIT: Sadly, this isn't a permanent solution as messages will start appearing after re-opning the emulator. I will be back with another update if I stumble upon a permanent fix.
Solution 4 - Android
I had a similar issue, for me I had setup a location listener:
location.onLocationChanged.listen(l) {
controller.animateCamera(...);
}
This appeared to be called even though the phone location had not changed, so I added a check to store the previous known location and in the listen, I compared the streamData with my location and only performed the update if there was a change.
Perhaps you can post your code to see if this could be the reason?
Solution 5 - Android
It's happening inside onLocationChanged method.
When I set isMyLocationEnabled to false at some extent it was removed but fully, now there were lesser log statement.
Solution 6 - Android
It happens when the map moves (or probably more specifically when it is redrawn). Both when animating, and also when manually sliding it around. My logcat is spammed full of Counters: exceeded sample count in FrameTime
messages. This explains why you'll see less when not having my location enabled: The map doesn't move as much...
It's so annoying.