christopher.online
christopher.online

Reputation: 2774

how to resolve mapbox reference in android app build?

I have integrated Mapbox into my Android app via Gradle.

  version = [
      mapboxMapSdk       : '6.8.1',
      mapboxSdkServices  : '4.3.0',
      mapboxEvents       : '3.5.7',
      mapboxNavigator    : '3.4.11',
      .....
  ]

  dependenciesList = [
      // mapbox
      mapboxMapSdk           : "com.mapbox.mapboxsdk:mapbox-android-sdk:${version.mapboxMapSdk}",
      mapboxSdkServices      : "com.mapbox.mapboxsdk:mapbox-sdk-services:${version.mapboxSdkServices}",
      mapboxSdkTurf          : "com.mapbox.mapboxsdk:mapbox-sdk-turf:${version.mapboxSdkServices}",
      mapboxEvents           : "com.mapbox.mapboxsdk:mapbox-android-telemetry:${version.mapboxEvents}",
      mapboxNavigator        : "com.mapbox.navigator:mapbox-navigation-native:${version.mapboxNavigator}",
      .....
  ]

During the build I get the following errors:

Unresolved reference: LocationEnginePriority 
Unresolved reference: LocationEngineListener 
None of the following functions can be called with the arguments supplied: @RequiresPermission public abstract fun requestLocationUpdates(@NonNull p0: LocationEngineRequest, p1: PendingIntent!): Unit defined in com.mapbox.android.core.location.LocationEngine
@RequiresPermission public abstract fun requestLocationUpdates(@NonNull p0: LocationEngineRequest, @NonNull p1: LocationEngineCallback<LocationEngineResult!>, @Nullable p2: Looper?): Unit defined in com.mapbox.android.core.location.LocationEngine

It is an old project I took over. Some of the dependencies seem like they cannot be resolved but I can not seem to pinpoint the exact problem. Trying to use the latest release latest.release of the mapbox libraries did not help. Do you know which dependencies I have to adjust?

Upvotes: 0

Views: 1954

Answers (1)

riastrad
riastrad

Reputation: 1774

It looks like you are not properly requesting/enabling permissions before you try to request location updates. This guide demonstrates how to do this properly: https://docs.mapbox.com/help/tutorials/android-location-listening/#handle-location-permissions


⚠️ Disclaimer: I currently work at Mapbox ⚠️

Upvotes: 1

Related Questions