-
Notifications
You must be signed in to change notification settings - Fork 1.3k
MapView in SupportMapFragment breaks after popping from backstack #13967
Comments
@AlexGrafl thank you for reaching out, reporting an issue and using our SDK. Really thankful for you adding some example code. We are aware of this issue with fragments and are working on a changing the way we create/destroy the underlying surface and native map object. Will report back with an update asap. |
When could we expect an update on this? Is there a workaround? It is currently a major blocking issue in our project :/ |
The idea is that #13976 fixes your issue but I will have to verify with a test first. Will also port your code to catch future regressions. |
Alright, thank you for your fast replies :) |
@AlexGrafl was able to reproduce your issue and while debugging I'm noticing that onResume and onStart aren't called for your setup. After searching for this online, it seems you shouldn't' swap out static declared fragments as mentioned by Jake Wharton here.
|
Interesting, but I even tested it when adding the fragment manually in the activities onCreate method, as I stated in my original issue report and in my demo project. The bevhiour does not change either way. |
When using the
SupportMapFragment
, replacing it with another fragment and popping the backstack, the map becomes unusable.I created a sample application showcasing this issue, see https://github.com/AlexGrafl/mapbox-fragment-test
Steps to reproduce
SupportMapFragment
as either part of the layout or a manual fragment transactionExpected behavior
The backstack is popped and the map view is displayed again and usable as it was before.
Actual behavior
The map is not usable anymore and error messages are thrown in the fashion of
You're calling `setGestureInProgress` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?
Note: In this demo application, the app is still responsive. In our real project where we encountered the problem we got segmentation faults and/or abort signals from native code and the app crashed. "Unfortunately" we could not reproduce this behavior in the demo (we used the
SupportMapFragment
inside another fragment, maybe that was the cause).Configuration
Android versions: Android 8, Android 9
Device models: Xiaomi Mi A1, Google Pixel 3
Mapbox SDK versions: 7.1.2
The text was updated successfully, but these errors were encountered: