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

java.lang.NoClassDefFoundError: com.mapbox.android.telemetry.NavigationMetadata #1984

Closed
saddahussain opened this issue Jun 26, 2019 · 4 comments

Comments

@saddahussain
Copy link

saddahussain commented Jun 26, 2019

**Android API:19
**Mapbox Navigation SDK version:0.40.0

Steps to trigger behavior

  1. getRoute by using NavigationRoute

  2. Then pass currentRoute and start navigation
    val options = NavigationLauncherOptions.builder() .directionsRoute(currentRoute) .shouldSimulateRoute(true) .build() NavigationLauncher.startNavigation(activity, options)

  3. Turn by turn navigation will open and then app will crash.

  4. Stacktrace java.lang.NoClassDefFoundError: com.mapbox.android.telemetry.NavigationMetadata at com.mapbox.services.android.navigation.v5.navigation.NavigationMetricsWrapper.departEvent(NavigationMetricsWrapper.java:173) at com.mapbox.services.android.navigation.v5.navigation.DepartEventHandler.send(DepartEventHandler.java:18) at com.mapbox.services.android.navigation.v5.navigation.DepartEventFactory.sendToHandler(DepartEventFactory.java:52) at com.mapbox.services.android.navigation.v5.navigation.DepartEventFactory.send(DepartEventFactory.java:23) at com.mapbox.services.android.navigation.v5.navigation.NavigationTelemetry.onRouteProgressUpdate(NavigationTelemetry.java:94) at com.mapbox.services.android.navigation.v5.navigation.NavigationEventDispatcher.sendMetricProgressUpdate(NavigationEventDispatcher.java:213) at com.mapbox.services.android.navigation.v5.navigation.NavigationEventDispatcher.onProgressChange(NavigationEventDispatcher.java:163) at com.mapbox.services.android.navigation.v5.navigation.RouteProcessorThreadListener.onNewRouteProgress(RouteProcessorThreadListener.java:34) at com.mapbox.services.android.navigation.v5.navigation.RouteProcessorRunnable$1.run(RouteProcessorRunnable.java:147) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:146) at android.app.ActivityThread.main(ActivityThread.java:5641) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1288) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1104) at dalvik.system.NativeStart.main(Native Method)

Expected behavior

Turn by turn navigation should start.

Actual behavior

App crashes as soon as turn by turn navigation opens.

@Guardiola31337
Copy link
Contributor

Hey @saddahussain 👋 thanks for reaching out and report your issue.

Are you including the Mapbox Maps SDK by any chance explicitly? If so, which version?

Noting that if you're using the Navigation UI SDK, you don't have to declare the Mapbox Maps SDK, it's included implicitly 👀

implementation dependenciesList.mapboxMapSdk
This is on purpose to avoid these kind of dependencies conflicts.

That being said, we’re always striving to upgrade to the latest versions of the different dependencies included in the SDK. This issue specifically is caused because the Events version included in Mapbox Maps SDK doesn't include the Navigation events 👀 mapbox/mapbox-events-android#383 - this was included in Events v4.5.0 and Events v4.5.1 landed in Maps v8.1.0 mapbox/mapbox-gl-native#14874 (any previous versions work 👌). We're tracking the work needed in the Navigation SDK side in #1890

There's a workaround that could be made in the meantime which is excluding the Events dependency from Maps SDK so that Events v4.4.1 from the Navigation SDK is used 👀

implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:8.1.0') {
  exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-telemetry'
}

Closing as answered. Please feel free to cut a new ticket if you run into any other issues. Thanks again!

@saddahussain
Copy link
Author

Thanks a lot. It solved the problem.

@Guardiola31337
Copy link
Contributor

@saddahussain glad to hear 🎉 Thanks for the update!

@djdance
Copy link

djdance commented Jun 28, 2019

the same crash. exclude doesn't help to me.
removing implementation('com.mapbox.mapboxsdk:mapbox-android-sdk:8.1.0') - helped.

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

No branches or pull requests

3 participants