当我尝试开始导航时:
MapboxNavigation navigation = new MapboxNavigation(this, Mapbox.getAccessToken(), options);
navigation.startNavigation(route);
我在运行时收到以下错误:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/mapbox/services/android/telemetry/location/LostLocationEngine;
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mapbox.services.android.telemetry.location.LostLocationEngine"
事实上,我无法从该位置导入类,但是 LocationEngine 可以从com.mapbox.services.android.location.LostLocationEngine
. 我认为这可能与依赖关系有关。这是我从 Gradle 文件中的 mapbox 构建的:
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places:0.3.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.5.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.12.0'
我该如何解决这个问题,以便我可以在我的应用程序中开始导航?