mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

Crash MapView#onStop() was not called.

Open MateusCarvalho opened this issue 9 years ago • 1 comments

Hello, I'm using a MapView in an activity and I've implemented all of the Mapview lifecycle methods in the activity, but I still get this error:

Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.app / com.MainActivity}: java.lang.IllegalStateException: MapView # onStop () was not called. You must call this method from the parent's {@link Activity # onStop ()} or {@link Fragment # onStop ()}.

The strange thing is that I am not using a fragment, but an activity.

Android API Version: 24 Mapbox Version: 5.0.2 Version of MapboxServices: 2.0.1

MateusCarvalho avatar Jun 04 '17 13:06 MateusCarvalho

I had this same exception thrown at me as recent as v5.1.0-beta.3.

I'm not able to reproduce it every time, but I noticed it happened when I pushed activity containing map to background, then resumed it and tried to back up and kill it, then it crashed.

The strange thing is that I am not using a fragment, but an activity.

Exception message is only a tip that you should call MapView # onStop () in the right lifecycle block, either Activity's or Fragment's, depending on your use.

LukasPaczos avatar Jun 05 '17 07:06 LukasPaczos