Mapbox-gl-native: Crash in Navigation after upgrading mapbox-android-sdk 6.5.0 -> 6.6.0

Created on 19 Oct 2018  路  8Comments  路  Source: mapbox/mapbox-gl-native

Hi,

I am using the following Mapbox libraries.

    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.6.0@aar'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.21.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.10.0'

As soon as I call MapboxNavigation.startNavigation(route), I am seeing this crash. It was working great up until 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.5.0@aar'. As soon as I bumped it up to 6.6.0, this crash started.

    java.lang.NoSuchMethodError: No direct method <init>(Ljava/util/Date;IIILjava/lang/String;Ljava/lang/String;ILjava/lang/String;DDLjava/lang/String;Ljava/lang/String;ZLjava/lang/String;I)V in class Lcom/mapbox/android/telemetry/NavigationMetadata; or its super classes (declaration of 'com.mapbox.android.telemetry.NavigationMetadata' appears in /data/app/com.bitspice.automate-6IJtfHRUDORuinxz1kwBRQ==/split_lib_dependencies_apk.apk:classes2.dex)
        at com.mapbox.services.android.navigation.v5.navigation.NavigationMetricsWrapper.departEvent(NavigationMetricsWrapper.java:175)
        at com.mapbox.services.android.navigation.v5.navigation.NavigationTelemetry.onRouteProgressUpdate(NavigationTelemetry.java:105)
        at com.mapbox.services.android.navigation.v5.navigation.NavigationEventDispatcher.sendMetricProgressUpdate(NavigationEventDispatcher.java:186)
        at com.mapbox.services.android.navigation.v5.navigation.NavigationEventDispatcher.onProgressChange(NavigationEventDispatcher.java:142)
        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:119)
        at android.os.Handler.handleCallback(Handler.java:789)
        at android.os.Handler.dispatchMessage(Handler.java:98)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6940)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

Android versions: Happens on different Android versions.
Device models: Happens on all devices I tested so far.

Are there configuration changes required when migrating from 6.5.0 to 6.6.0? Also, I am assuming the issue is related to the main Mapbox SDK, even though it's coming from the Navigation SDK, so I opened the issue here. I could be wrong.

Thanks.

Android

All 8 comments

Would you be able to provide the output for one of your app flavours using:

./gradlew :app_module_name_here:dependencies

The no such method error occurs when a dependency mismatch happens, the dependencies command will show the root cause.

Hi @tobrun, here's the output of that command, using the Mapbox Android SDK 6.5.0, and 6.60.

dependencies_6.5.0.txt
dependencies_6.6.0.txt

The issue stems from older telemetry version used by navigation:
The maps SDK uses v3.2.1, navigation uses 3.2.0.

+--- com.mapbox.mapboxsdk:mapbox-android-navigation:0.21.0
|    +--- com.mapbox.mapboxsdk:mapbox-android-telemetry:3.2.0 -> 3.2.1 (*)

It seems that by not following semantic versioning in that project, we have libraries that aren't compatible anymore. The only solution I'm seeing to make navigation compatible again with the maps sdk is a new release bumping this version.

cc @mapbox/mobile-telemetry @mapbox/navigation-android

Would a manual Gradle exclusion of 3.2.0 serve as a temporary workaround?

Hey @Kahtaf 馃憢 sorry about these issues you're facing here. @tobrun is correct, we had to make some updates for this telemetry release https://github.com/mapbox/mapbox-navigation-android/pull/1310/.

They will be included in the next release of the Navigation SDK (0.22.0), which should be happening before the end of the week. Thanks for your patience and I will follow up here when the release lands.

In the meantime, you can double check we have resolved your issue before the release with the 0.22.0-SNAPSHOT if you'd like https://github.com/mapbox/mapbox-navigation-android#using-snapshots

Thank you all for the quick feedback here. Sounds like we have a resolution for this issue in the upcoming nav release that can be tested today. I'm gonna go ahead and close this issue, if it still happens let's cut a new one on https://github.com/mapbox/mapbox-navigation-android.

Thank you folks for your hard work and quick turnaround. It's working with the snapshot. 馃憤

Just a heads up for anyone else who encounters this issue and can't figure it out, make sure you don't have any dependencies that themselves depend on earlier versions of the Telemetry API.

In my case I still had an old version of mapbox-android-ui in my app and it was causing the crash still to happen.

Was this page helpful?
0 / 5 - 0 ratings