Console gets spammed: Unable to acquire a buffer item... when using MapWidget inside IndexedStack
Description:
I'm using MapboxMapsFlutter with MapWidget embedded in a navigation tab that uses an IndexedStack to switch between screens. When I switch away from the tab containing the map (while keeping it in memory), the Android console gets spammed with the following warning:
W/ImageReader_JNI(18321): Unable to acquire a buffer item, very likely client tried to acquire more than maxImages buffers
This happens even if the map isn’t interacted with, and continues until I switch back.
Reproduction Steps:
Use MapWidget in a screen inside an IndexedStack.
Navigate to another tab, leaving the map alive but hidden.
Observe console spam from Android logs.
What I Need:
We want to keep the map alive and stateful across tabs (to preserve camera, markers, etc.), so disposing/reinitializing the map on every tab switch is not ideal.
Environment:
mapbox_maps_flutter: 2.8.0 Flutter version: 3.32.0 Device: Medium Phone API 35 (Android 15.0) | arm64
Flutter Doctor
usamaejaz@Usamas-MacBook-Pro ~ % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.32.0, on macOS 15.1 24B2083 darwin-arm64, locale en-AE) [✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.2) [✓] IntelliJ IDEA Community Edition (version 2024.3.2) [✓] Connected device (5 available) ! Error: Browsing on the local area network for Usama’s iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac. The device must be opted into Developer Mode to connect wirelessly. (code -27) [✓] Network resources
• No issues found!
+1
+1
+1
+1
+1
+1
Do you have any update or guidance regarding this?
I have same issue
+1
+1
I'm experiencing the same issue, and I'm not using an IndexedStack. The map is placed inside a regular widget, and that message shows up in the console repeatedly. When I interact with the map, it appears even more frequently. From what I’ve researched, the error seems to be related to acquiring too many images too quickly. (Tiles of the map)
How solved that ?
+1
Any news? I'm having the same problem.
Facing the same issue.
Any update? Facing the same issue.
I'm using the map on my Home Screen, when navigating to the another page, it's also the same problem.
+1
+1
+1