RN: 0.50.3
Android: 7.0
MapboxGL: 6.0.2
Hi,
I'm not sure if I'm doing something bad or it's an error in mabox component. The fact is that when I force to close the application and then open it quickly I'm receiving this message and then the app closes (I'm receiving this timeout even if I don't reopen the app):
12-14 18:14:53.553 2500 2532 W ActivityManager: Timeout executing service: ServiceRecord{41cab15 u0 com.devstep.compaz/com.mapbox.services.android.telemetry.service.TelemetryService}
It seems that the telemetry service remains open after closing the application.
+1 Same here!
Same issue with me
@nitaliano Hey man, any updates on this?
We should not be crashing the application here that is not the expected behavior and that will be looked in to.
As for the telemetry service staying open that is the intended behavior and this comment sums it up very nicely.
Let me know if there are any questions regarding the crash or the comment that I linked above
@nitaliano I tested something and it's a 50% work, on the RCTMGLMapViewManager.java on the onDropViewInstance method I added a mapView.onDestroy(); so right now if before closing the app I unmount the component the issue is gone, but the problem persists if I close the app using the MapView. Do you have any thought on it?
Interesting that to me says, that we're most likely not hitting this line https://github.com/mapbox/react-native-mapbox-gl/blob/master/android/rctmgl/src/main/java/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.java#L895 which is what should be calling onDestroy in this case
We're experiencing the same issue. In some cases we get an ANR caused by the TelemetryService after closing the app and opening it again.
For the while I have avoided this problem by exposing and disabling the telemetry service attribute.
I cannot reproduce this issue with master, but can reproduce it with 6.0.2 everytime. Would someone mind testing this out?
I tested this out with my Pixel running 7.0.0
@hernanmateo care to share how you did expose and disable the telemetry service attribute?
@nitaliano
We were still experiencing this with master as well. As for now, we've had to disable the telemetry on Android to not cause the crash.
@pohnean To disable Telemetry
Mapbox.getInstance(getApplicationContext(), getString(R.string.mapbox_public_token));
MapboxTelemetry.getInstance().setTelemetryEnabled(false);
I got similar issue, almost 50% of times when I open the app, it ARN's with error:
02-23 09:38:40.886: E/ActivityManager(1414): ANR in com.my.app
02-23 09:38:40.886: E/ActivityManager(1414): Reason: executing service com.my.app/com.mapbox.services.android.telemetry.service.TelemetryService
02-23 09:38:51.018: W/ActivityManager(1414): Service crashed 2 times, stopping: ServiceRecord{a7478ea u0 com.my.app/com.mapbox.services.android.telemetry.service.TelemetryService}, avgRestartTime: 9223372036854775807
Im using:
RN: 0.52.2
mapbox-gl: 6.0.3-rc1
Android: 8
@hannta yep, it's a known issue. Please disable Telemetry
This should not be an issue anymore with 6.1.0 you should not experience an ANR, the telemetry service is going to stay open it is in the terms or service. If someone runs into this with 6.1.0 reopen please
@jesusmartinoza would you mind sharing where I can add those lines for disabling telemetry? I don't have a lot of Android developer experience - I'm developing the app in react-native. We are seeing random crashes after about 5 mins and it seems to be related to the telemetry service when the phone does not have an internet connection. I'd like to try disabling it to narrow down where the problem is coming from.
Most helpful comment
@hernanmateo care to share how you did expose and disable the telemetry service attribute?