Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix locationManager crash on Android #2803

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

tomasMizera
Copy link
Collaborator

Moved the call to parent destructor to the last line and added a check if the locationManager is already NULL.
Though it is not clear why it would be NULL

https://app.clickup.com/t/862ke67ea

@PeterPetrik
Copy link
Contributor

This was 20% of recent crashes on android play

Exception java.lang.RuntimeException:
  at android.app.ActivityThread.handleStopService (ActivityThread.java:5293)
  at android.app.ActivityThread.-$$Nest$mhandleStopService
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2452)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8757)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'void android.location.LocationManager.removeUpdates(android.location.LocationListener)' on a null object reference
  at uk.co.lutraconsulting.PositionTrackingService.onDestroy (PositionTrackingService.java:88)
  at android.app.ActivityThread.handleStopService (ActivityThread.java:5273)

@tomasMizera tomasMizera merged commit c4f72ab into master Sep 25, 2023
5 of 7 checks passed
@tomasMizera tomasMizera deleted the tracking-crash-on-destroy branch September 25, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants