mapbox-android-binding icon indicating copy to clipboard operation
mapbox-android-binding copied to clipboard

App does not restart after closing it

Open Niach opened this issue 6 years ago • 16 comments

If you swipe the app away in the recent apps, you cannot start the app again and it is stuck in the splashscreen. I think maybe the mapbox service is not closed and prevents the mainactivity to start again. This behaviour also occures in the sample app.

Niach avatar Apr 07 '18 14:04 Niach

Same on my side, cannot start the app again after closing it. You can check it using your own sample application.

mdenkmaier avatar Apr 12 '18 08:04 mdenkmaier

How do you guys say closing it? It works well at my end. (open <=> close)

tuyen-vuduc avatar Apr 13 '18 05:04 tuyen-vuduc

Same, swipe the app away out of the recent apps(no explicit killing) and open it again -> infinite loop

cschwengler avatar Apr 13 '18 12:04 cschwengler

I'm using it in a Fragment and did it like in your blog post:

public override void OnDestroyView()
        {
            mapView?.RemoveOnMapChangedListener(this);
			mapView?.OnDestroy();
			base.OnDestroyView();
        }

Niach avatar Apr 13 '18 13:04 Niach

@cschwengler On which device did you face the issue?

@Niach Have you faced the same issue on my sample?

Plz check device log where there are a lot of details for us to investigate deeper.

I didn't face any issues when closing app/opening app on simulator.

Cheers.

tuyen-vuduc avatar Apr 13 '18 16:04 tuyen-vuduc

On a Oneplus 3 with Oxygen OS, Android 8.0

cschwengler avatar Apr 13 '18 17:04 cschwengler

Hey,

I couldn't replicate your issue without more details.

Plz connect device and try to debug then get the logcat details.

Thanks.

tuyen-vuduc avatar Apr 14 '18 07:04 tuyen-vuduc

Hey, i found whats going wrong. Its happening if you enabled the Mapbox TelemetryService. Maybe you disabled it on your testing device. If its enabled and you try to restart the app, it hangs.

cschwengler avatar Apr 16 '18 11:04 cschwengler

I made a video of your sample app: https://www.youtube.com/watch?v=AZg2D2dGa7U After force-killing the app it works again, and if you disagree with the telemetry service it also works.

Niach avatar May 14 '18 08:05 Niach

I think this is the problem: https://github.com/mapbox/react-native-mapbox-gl/issues/878 https://github.com/mapbox/react-native-mapbox-gl/issues/906 https://github.com/mapbox/react-native-mapbox-gl/issues/1023 Should got fixed with Mapbox 6.1.0

Niach avatar May 25 '18 08:05 Niach

The problem seems to appear only on your xamain.forms sample and not in your android sample app. Maybe it has something to do with the Fragment?

Niach avatar May 28 '18 07:05 Niach

Plz check back v6.4 now.

tuyen-vuduc avatar Sep 19 '18 07:09 tuyen-vuduc

Hi Guys,

I have just tested v6.4, and the bug still exists. Start app (OK), close it by pressing device back button (app closes), click on the app icon again (BUG: app freezes). It happens by Xamarin Forms. Tested on Samsung Galaxy A5, Android 8.0.0.

tmatrai avatar Nov 01 '18 22:11 tmatrai

After investigating this bug I found that calling Android.OS.Process.KillProcess(Android.OS.Process.MyPid()); in maprenderer after fragment = null; in dispose method it "solves" the problem, the app can be re-started successfully. I don't feel it a bugfix of course, it seems a brutal "solution", but hopefully can lead to the fix by pointing out it can be some lifecycle / fragment dispose related problem.

tmatrai avatar Nov 02 '18 09:11 tmatrai

When you open app by tapping a push message on Android, app start also hangs if there is a MapBox map on the start page of the app. In this case it does not matter how you closed it before, so a simple home button pressing close also can lead to this error. Samsung Galaxy A5, Android 8.0.0.

tmatrai avatar Nov 05 '18 09:11 tmatrai

App freezes due to fragment dispose related problem. This issue occur in Xamarin Forms. I tried not using fragment and follow the same approach like what amay077 did in Xamarin.Forms.GoogleMaps in creating the view that can be found in this link https://github.com/amay077/Xamarin.Forms.GoogleMaps/blob/master/Xamarin.Forms.GoogleMaps/Xamarin.Forms.GoogleMaps.Android/MapRenderer.cs#L119 and it solves the problem.

stephenmante avatar Nov 08 '18 01:11 stephenmante