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

Errors after unmount component (Android only) #2

Closed
rapomon opened this issue Dec 13, 2020 · 3 comments
Closed

Errors after unmount component (Android only) #2

rapomon opened this issue Dec 13, 2020 · 3 comments
Labels

Comments

@rapomon
Copy link

rapomon commented Dec 13, 2020

Hi!

I use react natigation to show the mapboxnavigation in a new screen, after press back button I have several errors in the console, I suppose the mapbox instance should be detroyed correctly before unmount the component.

[Sun Dec 13 2020 10:51:27.812]  ERROR    Mapbox error You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:27.850]  ERROR    Mapbox error You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:27.883]  ERROR    Mapbox error You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:27.907]  WARN     Mapbox warning Style is not fully loaded, not able to get source! {"level": "warning", "message": "Style is not fully loaded, not able to get source!", "tag": "mbgl-locationSymbol"}
[Sun Dec 13 2020 10:51:27.936]  ERROR    Mapbox error You're calling `getMetersPerPixelAtLatitude` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `getMetersPerPixelAtLatitude` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:27.967]  ERROR    Mapbox error You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:27.998]  ERROR    Mapbox error You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.370]  ERROR    Mapbox error You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.630]  ERROR    Mapbox error You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.900]  ERROR    Mapbox error You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.116]  ERROR    Mapbox error You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.146]  ERROR    Mapbox error You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.177]  ERROR    Mapbox error You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.204]  ERROR    Mapbox error You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.232]  ERROR    Mapbox error You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.263]  ERROR    Mapbox error You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.289]  ERROR    Mapbox error You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `getCameraValues` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.316]  ERROR    Mapbox error You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `cancelTransitions` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
[Sun Dec 13 2020 10:51:28.350]  ERROR    Mapbox error You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`? {"level": "error", "message": "You're calling `jumpTo` after the `MapView` was destroyed, were you invoking it after `onDestroy()`?", "tag": "Mbgl-NativeMapView"}
@rossmartin
Copy link
Contributor

rossmartin commented Dec 13, 2020

Thanks for noting this and I'm aware of these logs as of the latest release (0.1.7). The native android view (mapbox NavigationView) is being destroyed and the appropriate mapbox teardown is being done. Prior to this new release there was a lifecycle issue where you could not mount the MapboxNavigation component again after it had been used before.

I tried to get rid of these errors that crop up after destroying the NavigationView but could not figure it out. I think there is a flaw in how the NavigationView shutdown is implemented. If you dig deep enough you'll see that the onDestroy here calls super.onDestroy() (which is the onDestroy of the NavigationView in the SDK because the RN MapboxNavigationView extends it, and there it calls shutdown in that class).

I'll leave this issue open for anyone else that might come across it. It is working as intended despite these errors showing from the native SDK.

@rossmartin rossmartin changed the title Errors after unmount component Errors after unmount component (Android only) Dec 13, 2020
@rapomon
Copy link
Author

rapomon commented Dec 14, 2020

Thank you for the detaile explanation.

Anyway, the application works fine and the app does not crash.

Best regards.

@rossmartin
Copy link
Contributor

Hey I wanted to provide an update on this based on a finding. This will not occur in a release build on android. It only happens when running a debug build and the slowdown appears to be caused by the RN bridge getting flooded with logs.

NathanNovak added a commit to StraboSpot/StraboSpot2 that referenced this issue Aug 27, 2021
gciluffo pushed a commit that referenced this issue Feb 3, 2022
…roid-sdk

Update styling for android view to allow more screen real estate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants