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

DeadObjectException with SNAPSHOT 3.0.1 #218

Closed
tobrun opened this issue Jun 13, 2017 · 31 comments
Closed

DeadObjectException with SNAPSHOT 3.0.1 #218

tobrun opened this issue Jun 13, 2017 · 31 comments
Assignees

Comments

@tobrun
Copy link

tobrun commented Jun 13, 2017

We hit a DeadObjectException using the following SNAPSHOT

com.mapzen.android:lost:3.0.1-20170607.212149-4

Sadly we don't have a reprodicible use-case. Will update the ticket if we have more information.

9: 32: 05.801 10677 - 10677 / com.mapbox.mapboxsdk.testapp: lost E / AndroidRuntime: FATAL EXCEPTION: main
Process: com.mapbox.mapboxsdk.testapp: lost, PID: 10677
java.lang.RuntimeException: android.os.DeadObjectException
at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java: 78)
at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java: 196)
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java: 281)
at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java: 210)
at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java: 233)
at android.os.Handler.dispatchMessage(Handler.java: 102)
at android.os.Looper.loop(Looper.java: 135)
at android.app.ActivityThread.main(ActivityThread.java: 5312)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java: 372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 696)
Caused by: android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java: 496)
at com.mapzen.android.lost.internal.IFusedLocationProviderCallback$Stub$Proxy.onLocationChanged(IFusedLocationProviderCallback.java: 104)
at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java: 76)
at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java: 196)
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java: 281)
at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java: 210)
at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java: 233)
at android.os.Handler.dispatchMessage(Handler.java: 102)
at android.os.Looper.loop(Looper.java: 135)
at android.app.ActivityThread.main(ActivityThread.java: 5312)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java: 372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 901)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 696)

cc @sarahlensing @Guardiola31337 @zugaldia

@tobrun tobrun changed the title DeadObjectException with SNAPSHOT 3..0.1 DeadObjectException with SNAPSHOT 3.0.1 Jun 13, 2017
@13kz
Copy link

13kz commented Jun 14, 2017

We already get this one with version 3.0.0. Of course without a reproducible use-case

@sarahsnow1
Copy link
Contributor

@tobrun @13kz Thanks for the report, we will look into this soon

@invised
Copy link

invised commented Jun 15, 2017

I am using Mapbox, and I have a SyncAdapter in my app, which runs in a separate process, Mapbox was initialized in Application.onCreate(). So that Mapbox actually was initialized twice: during main app process launch, and everytime when SyncAdapter was running, after ensuring that Mapbox initialized only in main process, this error ALMOST gone. As I remember, the Mapbox in secondary process caused Lost service to be started and not closed, even though the caller process is gone.

@lidkxx
Copy link

lidkxx commented Jun 19, 2017

Can confirm it's happening for our app users on multiple phones, Samsung Galaxy A5(2017) (a5y17lte) with Android 6.0, Samsung Galaxy J3(2016) (j3xnlte) Android 5.1, LG Spirit 4G LTE (c70n) Android 6.0 so far. Don't know how to reproduce this behaviour for tests.
Using com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.2@aar and com.mapbox.mapboxsdk:mapbox-android-services:2.1.1@aar

@lidkxx
Copy link

lidkxx commented Jun 19, 2017

Apart from the above RuntimeException caused by DeadObjectException, for Android 5.1 we're also getting a RuntimeException caused by TransactionTooLargeException

java.lang.RuntimeException: at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:78) at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java:196) at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:286) at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:215) at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:238) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6934) at java.lang.reflect.Method.invoke(Native Method:0) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) Caused by: android.os.TransactionTooLargeException: at android.os.BinderProxy.transactNative(Native Method:0) at android.os.BinderProxy.transact(Binder.java:496) at com.mapzen.android.lost.internal.IFusedLocationProviderCallback$Stub$Proxy.onLocationChanged(IFusedLocationProviderCallback.java:104) at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:76)

@paulVulog
Copy link

paulVulog commented Jun 20, 2017

I just notice in my app that my Application onCreate() method is called twice.
Is it the same issue ?

  • com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0-beta.4@aar
  • com.mapbox.mapboxsdk:mapbox-android-sdk:2.1.1@aar
  • com.mapzen.android:lost:3.0.1

@invised
Copy link

invised commented Jun 20, 2017

I guess it is called twice, because Lost service is running in a separate process, so that Application object is created for every process

@lidkxx
Copy link

lidkxx commented Jun 20, 2017

Hey, I am trying to upgrade MapBox from 5.0.2 to 5.1.0-beta.xbut I am getting 'cannot resolve method' on getLocationEngine() method below:

private LocationEngine locationEngine = LocationSource.getLocationEngine(myAppContext);

How should I be calling it with 5.1.0?
Sorry for asking in this thread, but I cannot grasp what's changed and didn't know where else to ask.

@msmollin
Copy link
Contributor

Hey everyone, we're still working towards actually being able to reproduce this issue so we appreciate your patience in this matter, and appreciate any additional notes towards diagnosing this problem.

@lidkxx For your RuntimeException/TransactionTooLargeException please open a separate issue in this repository as it appears related to LOST. Please post any and all relevant information that the issue template asks for. For your second issue, please open a ticket in the relevant MapBox repository as this is not a MapBox-owned repository and you won't receive the assistance you need. I would start by opening an issue here: https://github.com/mapbox/mapbox-gl-native

@lidkxx
Copy link

lidkxx commented Jun 21, 2017

@msmollin Thanks! Sorry for asking it up here, had to many github issues opened and thought I'm typing in one of MapBox threads 😬

@msmollin
Copy link
Contributor

@lidkxx No worries at all. If you could open a separate issue about the TransactionTooLargeException exception along with relevant device and android API level information, that would be great because we've not seen that in our testing!

@msmollin msmollin added the next label Jun 21, 2017
@joaopedro1520
Copy link

joaopedro1520 commented Jun 22, 2017

These are all the crashes im getting in order of the higher number of crashes.
Using the latest mapbox snapshot which contains lost version 3.0.1 .
The crashes happen in all android versions with a higher impact on samsung devices and latest android versions ( 6 , 7)

One of the crashes might be cause inside mapbox location @tobrun

#1

Fatal Exception: java.lang.RuntimeException: android.os.DeadObjectException at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(SourceFile:78) at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(SourceFile:196) at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297) at android.location.LocationManager$ListenerTransport.-wrap0(LocationManager.java) at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:249) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6692) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358) Caused by android.os.DeadObjectException at android.os.BinderProxy.transactNative(Binder.java) at android.os.BinderProxy.transact(Binder.java:628) at com.mapzen.android.lost.internal.IFusedLocationProviderCallback$Stub$Proxy.onLocationChanged(SourceFile:104) at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(SourceFile:76) at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(SourceFile:196) at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297) at android.location.LocationManager$ListenerTransport.-wrap0(LocationManager.java) at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:249) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6692) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

#2

Fatal Exception: java.lang.IllegalStateException: Location update received after client was disconnected. Did you forget to unregister location updates before disconnecting? at com.mapzen.android.lost.internal.FusedLocationServiceCallbackManager.onLocationChanged(SourceFile:31) at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl$1$1.run(SourceFile:47) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

#3

Fatal Exception: java.lang.RuntimeException: Unable to stop activity java.lang.RuntimeException: android.os.DeadObjectException at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3305) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3359) at android.app.ActivityThread.access$1300(ActivityThread.java:143) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4960) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) at dalvik.system.NativeStart.main(NativeStart.java) Caused by java.lang.RuntimeException: android.os.DeadObjectException at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.removeLocationUpdatesInternal(SourceFile:189) at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.removeLocationUpdates(SourceFile:198) at com.mapbox.mapboxsdk.location.LocationSource.removeLocationUpdates(SourceFile:146) at com.mapbox.mapboxsdk.maps.widgets.MyLocationView.toggleGps(SourceFile:461) at com.mapbox.mapboxsdk.maps.widgets.MyLocationView.toggleGps(SourceFile:429) at com.mapbox.mapboxsdk.maps.widgets.MyLocationView.onStop(SourceFile:356) at com.mapbox.mapboxsdk.maps.TrackingSettings.onStop(SourceFile:409) at com.mapbox.mapboxsdk.maps.MapboxMap.onStop(SourceFile:120) at com.mapbox.mapboxsdk.maps.MapView.onStop(SourceFile:259) at com.mapbox.mapboxsdk.maps.SupportMapFragment.onStop(SourceFile:126) at android.support.v4.app.Fragment.performStop(SourceFile:2384) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1363) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(SourceFile:1528) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1595) at android.support.v4.app.FragmentManagerImpl.dispatchStop(SourceFile:2931) at android.support.v4.app.Fragment.performStop(SourceFile:2380) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1363) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(SourceFile:1528) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1595) at android.support.v4.app.FragmentManagerImpl.dispatchStop(SourceFile:2931) at android.support.v4.app.FragmentController.dispatchStop(SourceFile:245) at android.support.v4.app.FragmentActivity.onStop(SourceFile:627) at android.support.v7.app.AppCompatActivity.onStop(SourceFile:184) at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1219) at android.app.Activity.performStop(Activity.java:5341) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3300) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3359) at android.app.ActivityThread.access$1300(ActivityThread.java:143) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4960) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) at dalvik.system.NativeStart.main(NativeStart.java) Caused by android.os.DeadObjectException at android.os.BinderProxy.transact(Binder.java) at com.mapzen.android.lost.internal.IFusedLocationProviderService$Stub$Proxy.removeLocationUpdates(SourceFile:255) at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.removeLocationUpdatesInternal(SourceFile:187) at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.removeLocationUpdates(SourceFile:198) at com.mapbox.mapboxsdk.location.LocationSource.removeLocationUpdates(SourceFile:146) at com.mapbox.mapboxsdk.maps.widgets.MyLocationView.toggleGps(SourceFile:461) at com.mapbox.mapboxsdk.maps.widgets.MyLocationView.toggleGps(SourceFile:429) at com.mapbox.mapboxsdk.maps.widgets.MyLocationView.onStop(SourceFile:356) at com.mapbox.mapboxsdk.maps.TrackingSettings.onStop(SourceFile:409) at com.mapbox.mapboxsdk.maps.MapboxMap.onStop(SourceFile:120) at com.mapbox.mapboxsdk.maps.MapView.onStop(SourceFile:259) at com.mapbox.mapboxsdk.maps.SupportMapFragment.onStop(SourceFile:126) at android.support.v4.app.Fragment.performStop(SourceFile:2384) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1363) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(SourceFile:1528) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1595) at android.support.v4.app.FragmentManagerImpl.dispatchStop(SourceFile:2931) at android.support.v4.app.Fragment.performStop(SourceFile:2380) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1363) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(SourceFile:1528) at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1595) at android.support.v4.app.FragmentManagerImpl.dispatchStop(SourceFile:2931) at android.support.v4.app.FragmentController.dispatchStop(SourceFile:245) at android.support.v4.app.FragmentActivity.onStop(SourceFile:627) at android.support.v7.app.AppCompatActivity.onStop(SourceFile:184) at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1219) at android.app.Activity.performStop(Activity.java:5341) at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3300) at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3359) at android.app.ActivityThread.access$1300(ActivityThread.java:143) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4960) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1038) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:805) at dalvik.system.NativeStart.main(NativeStart.java)

Fatal Exception: java.lang.RuntimeException: android.os.DeadObjectException at com.mapzen.android.lost.internal.FusedLocationServiceCallbackManager.onLocationChanged(SourceFile:42) at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl$1$1.run(SourceFile:47) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) Caused by android.os.DeadObjectException at android.os.BinderProxy.transactNative(Binder.java) at android.os.BinderProxy.transact(Binder.java:615) at com.mapzen.android.lost.internal.IFusedLocationProviderService$Stub$Proxy.getLocationAvailability(SourceFile:206) at com.mapzen.android.lost.internal.FusedLocationServiceCallbackManager.onLocationChanged(SourceFile:40) at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl$1$1.run(SourceFile:47) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

@westnordost
Copy link
Contributor

DeadObjectException

Same stacktrace for StreetComplete users. Looking at the crash reports by Android version, 94% (of 105 reports) of the crashes happen on the same Android version and the same device!:

  • Device: Moto G (3rd Gen) (osprey_umts)
  • Android 6.0

Hope that information helps to track down the problem.

@joaopedro1520
Copy link

I was able to reproduce the steps for one of the crashes above not sure if its caused by mapbox or LOST
Android 6 / 7

  • Open app and deny location permissions ( activity with mapbox map)
  • Go to another activity with other map
  • Go back to previous activity and request location
  • After location is granted and the user position is moved open again the activity of step 2 and the app after few seconds crashes

`Fatal Exception: java.lang.IllegalStateException: Location update received after client was disconnected. Did you forget to unregister location updates before disconnecting? at com.mapzen.android.lost.internal.FusedLocationServiceCallbackManager.onLocationChanged(SourceFile:31) at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl$1$1.run(SourceFile:47) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

`

@westnordost
Copy link
Contributor

@joaopedro1520 : I made a new bug report for this, lets have one bug report per issue. I created #224

@joaopedro1520
Copy link

@westnordost The deadobject doesn't only happen on that Motorola. In my happy several brands of phones are crashing in all android versions, so it's not that specific

@Kahtaf
Copy link

Kahtaf commented Jun 23, 2017

Also seeing a similar issue on a Nexus 6P and Android 7.1.2. It happens when a route navigation is active and I send the app to the background (press the home button for example).

java.lang.RuntimeException: android.os.DeadObjectException at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:78) at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java:191) at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297) at android.location.LocationManager$ListenerTransport.-wrap0(LocationManager.java) at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:249) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6121) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779) Caused by: android.os.DeadObjectException at android.os.BinderProxy.transactNative(Native Method) at android.os.BinderProxy.transact(Binder.java:615) at com.mapzen.android.lost.internal.IFusedLocationProviderCallback$Stub$Proxy.onLocationChanged(IFusedLocationProviderCallback.java:104) at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:76)

@msmollin
Copy link
Contributor

Hey everyone! I just wanted to give a quick update on the status of this issue.

Since we've been unable to reproduce this in our sample code in this repository, we took the time to upgrade our complex sample mapping app EraserMap to utilize the latest version of LOST. This resulted in us reproducing one of the issues listed in this issue. You can see the root-cause analysis @sarahlensing performed here: mapzen/eraser-map#824

That said we still have not managed to reproduce the original DeadObjectException reported by @tobrun. However we believe they are all inter-related as a race condition in our respective apps (thus why the difficulty in attempting to replicate it) and we're going to test out making the changes listed in the EM ticket in LOST to see if they help fix these issues we're seeing. We're also evaluating #227 to see if that change will also potentially resolve one of the other issues listed here.

Thanks for the continued patience here and all the additional support debugging it. Please continue to post any more information you find and in the mean time we're focused on resolving this.

@westnordost
Copy link
Contributor

Since the crash happens on the main thread and users cannot work around it by wrapping LOST related code in try-catch, maybe it would be good to catch a DeadObjectException in FusedLocationProviderServiceDelegate.reportLocation and log it as an error to console instead of tearing down the whole app (plus useful debug information that may be helpful to track down the root problem).
From app developers that use the library, I think you won't get any more detailed information than what you already got - the stack trace.

In neither DeadObjectException nor IBinder.transact (where the exception is thrown) it is properly documented from Google when this is thrown. This makes the call to transact a random factor which should not affect the stability of the library (and thus apps that depend on it).
I would say that shows that RemoteException (and thus DeadObjectException) is a checked exception not for nothing, like IOException etc. it is an exception that one has to explicitly deal with because it may be not within control of the LOST library when this exception is thrown. Wrapping it into a RuntimeException and rethrowing it like it is done now is like to assume that whenever this exception appears it would always be a programming error on the side of LOST.

@sarahsnow1
Copy link
Contributor

Catching this exception will be the way forward. As @msmollin mentioned, we haven't been able to reproduce it but needed to spend time trying to. And as @westnordost says, this shouldn't bring the whole app down.

@sarahsnow1 sarahsnow1 removed the ready label Jun 29, 2017
@chandreshandroid
Copy link

chandreshandroid commented Jul 1, 2017

i am getting same issue

java.lang.RuntimeException: android.os.DeadObjectException at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation

Mapbox Sdk: com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.0-SNAPSHOT@aar
Android version 6.0 Marshmallow

please guide me what can i do for this one

Thanks

@giperwlad
Copy link

giperwlad commented Jul 4, 2017

I also got crash.

SDK: 5.1.0-beta.4
Android: 7.0

Stack trace:

      Fatal Exception: java.lang.RuntimeException: android.os.DeadObjectException
   at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:79)
   at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java:196)
   at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297)
   at android.location.LocationManager$ListenerTransport.-wrap0(LocationManager.java)
   at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:249)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:154)
   at android.app.ActivityThread.main(ActivityThread.java:6688)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
     Caused by android.os.DeadObjectException
   at android.os.BinderProxy.transactNative(Binder.java)
   at android.os.BinderProxy.transact(Binder.java:628)
   at com.mapzen.android.lost.internal.IFusedLocationProviderCallback$Stub$Proxy.onLocationChanged(IFusedLocationProviderCallback.java:104)
   at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:77)
   at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java:196)
   at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297)
   at android.location.LocationManager$ListenerTransport.-wrap0(LocationManager.java)
   at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:249)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:154)
   at android.app.ActivityThread.main(ActivityThread.java:6688)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

@AkikoGoto
Copy link

I also got same crash.
In my case, it occurs many hours after I get my application background.

ANDROID_VERSION=7.0
BRAND=samsung
PHONE_MODEL=SC-02H
CUSTOM_DATA=
STACK_TRACE=java.lang.RuntimeException: android.os.DeadObjectException
at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:78)
at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java:196)
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297)
at android.location.LocationManager$ListenerTransport.-wrap0(LocationManager.java)
at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:249)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6646)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:628)
at com.mapzen.android.lost.internal.IFusedLocationProviderCallback$Stub$Proxy.onLocationChanged(IFusedLocationProviderCallback.java:104)
at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:76)
... 10 more
android.os.DeadObjectException
at android.os.BinderProxy.transactNative(Native Method)
at android.os.BinderProxy.transact(Binder.java:628)
at com.mapzen.android.lost.internal.IFusedLocationProviderCallback$Stub$Proxy.onLocationChanged(IFusedLocationProviderCallback.java:104)
at com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation(FusedLocationProviderServiceDelegate.java:76)
at com.mapzen.android.lost.internal.FusionEngine.onLocationChanged(FusionEngine.java:196)
at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:297)
at android.location.LocationManager$ListenerTransport.-wrap0(LocationManager.java)
at android.location.LocationManager$ListenerTransport$2.handleMessage(LocationManager.java:249)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6646)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)

@adamus
Copy link

adamus commented Jul 17, 2017

We are encountering a lot of these exceptions, different devices and all Android system versions are affected.

com.mapzen.android.lost.internal.FusedLocationProviderServiceDelegate.reportLocation, FusedLocationProviderServiceDelegate.java, line 78
mapBoxServicesVersion = '2.1.1'
mapBoxSdkVersion = '5.0.2'
mapBoxGeocoderVersion = '1.0.0'

@msmollin
Copy link
Contributor

msmollin commented Jul 17, 2017

Hey Folks,
Looks like we didn't actually announce this here... sorry about that. We recently push a new release of LOST out which (hopefully) should no longer crash with this exception. It is now logged to the console using Log.e. See Relevant PR here - #230

@msmollin msmollin reopened this Jul 17, 2017
@msmollin
Copy link
Contributor

I'm re-opening this issue because I would really like if people see this error message to post the log results here. We've continued to have problems actually reproducing this problem and so if you see those log messages (especially @tobrun and friends from Mapbox) put those in here so we can hopefully see if there's anything more we can do.

@msmollin
Copy link
Contributor

Relevant release to the above remarks: https://github.com/mapzen/lost/releases/tag/lost-3.0.2

@lidkxx
Copy link

lidkxx commented Aug 17, 2017

Any news on this?

@msmollin
Copy link
Contributor

msmollin commented Aug 17, 2017

@lidkxx As far as we know this has been "fixed" by the above mentioned release. I only re-opened it in the event people are seeing logs to the console with this message. Since there's been no activity since then, I'll probably re-close it for now and if people see the log messages we can reopen as needed.

@Guardiola31337
Copy link

@msmollin DeadObjectException is back 😞
👀 #241

@nitaliano
Copy link

There is a repo created by @henrikra that can reproduce this issue every time using older Android devices nitaliano/react-native-mapbox-gl#925 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests