Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

MapView.onDestroy() freezes at nativeDestroy when map is used inside dialog fragment #14025

Closed
androideveloper opened this issue Mar 4, 2019 · 4 comments · Fixed by #14036
Closed
Labels
Android Mapbox Maps SDK for Android needs information

Comments

@androideveloper
Copy link

androideveloper commented Mar 4, 2019

When map is used inside DialogFragment, NativeDestroy freezes and never completes. The sample I have created is using SupportMapFragment inside DialogFragment, but I have also tried to extend Fragment and inmplement map logic inside. The same result.
I have found similar issues here: #11153 #10809

Steps to reproduce

Mapdox Crash Demo (insert your map key in strings.xml)

  1. Open this sample app
  2. Click on button, map dialog is opened
  3. Click Finish or Cancel, app freezes

Expected behavior

mapView.onDestroy() completes without issue

Actual behavior

Call to destroy freezes thread

Configuration

Android versions: 9.0, 8.1
Device models: Xiaomi mi a2 lite, Moto g5 plus
Mapbox SDK versions: v7.2.0

@LukasPaczos
Copy link
Contributor

Hey @androideveloper, thanks for reporting the issue. I understand, that you're calling MapView#onDestroy from fragment's #onDestroyView and still running into a freeze, right? Could you compare your setup to this example? Do you spot any differences?

@LukasPaczos LukasPaczos added Android Mapbox Maps SDK for Android needs information labels Mar 4, 2019
@androideveloper
Copy link
Author

Right. Actually I'm using SupportMapFragment inside my dialog as a child fragment. That's the main difference between these setups. But I have imported your code into my sample project and still get freeze! The only difference as I can see is that I have changed your example Fragments from v4 to AndroidX version.

@androideveloper
Copy link
Author

I have even tried to convert the app to old appcompat 27.1.1, that is used in your sample and still get the same freeze!

@androideveloper
Copy link
Author

Here is update including your demo Updated Demo

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android needs information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants