I am running a background task to track locations with Location.startLocationUpdatesAsync(). Everything works great. However if I kill the app by swiping up on Android, I get a message that says "MyApp keeps stopping". I have isolated the problem to the TaskManager. Whenever I don't use it, there is no problem killing the app.
I have searched for a solution for weeks with no luck. My guess is the TaskManager keeps running, but runs into some problem since the app has been unmounted. Is there anyway to run a clean up function when killing the app to unregister all tasks or is there a better way to do this?