-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Mapbox Android - Crash when rotating screen #12614
Comments
Hey @Mordag, thanks for reaching out and reporting your issue. Some follow up questions:
|
Hi @tobrun, Do you have any ideas about my provided crash log? |
@tobrun yes I am calling the onDestroy from the Fragment#onDestroy.
|
@Mordag thank you for the additional information, though not able to reproduce with fragments 🤔 |
@tobrun I did some more testing and I only get the crash on my Moto G5. I have tried some Pixel phones as well but had no problems on those phones. It also seems like that the crash always happens as soon as you rotate the mapview. I will do some more testing to give you some more information if that is only the Moto G5 or has something to do with a specific hardware component. Update: I have tested the MapBox Demo app with the Moto G5 and I got no problems there. |
@tobrun I've tested the issue with the latest mapbox release (6.4.0) which includes a better reporting:
|
I symbolicated this trace to:
There is not much to go off except for the layer code but this code potentially be any layer. Would you be able to share more details about your setup? used components? or a minimal reproducible example? Thank you. |
What components do you mean? Layers? App dependencies? Or something else? I will try to start removing stuff from my current implementation to see if that changes anything. After that, I might create a minimal example. |
I did some more testing before I start creating an example. If I remove android:configChanges="orientation" from the activity that holds the fragment that holds the mapview then I get a different crash log. Maybe that helps you to get a better idea?
|
@tobrun I found the root problem. If I rotate the activity and recreate the mapview (adding everything back), the method mapbox.getLayer(id) is throwing an exception.
|
I probably won't be able to provide any simplified example for the crash anytime soon. Therefore I will close the issue. |
I have implemented a feature detail screen (seperate activity) that I can access when I click a marker on the mapview. The activity which holds mapbox has the following config to ignore orientation changes: android:configChanges="orientation". The feature detail screen can process and react to any orientation change.
The app crashes when I enter the feature detail screen in any orientation, change the orientation to a new one, go back to the mapview and try to move/zoom using the map.
I get the following crash report:
Configuration
Android versions: 7.0.0
Device models: Moto G5
Mapbox SDK versions: 6.3.0
The text was updated successfully, but these errors were encountered: