Skip to main content

Android SDK Version Conflicts

If you're experiencing crashes when using multiple Mapbox Android SDKs (Search, Maps, Navigation) together, the issue is likely due to version conflicts between the underlying Common SDK dependencies.

Symptoms

  • App crashes when initializing or using multiple Mapbox SDKs
  • Runtime exceptions related to class loading or method resolution
  • Inconsistent behavior between different SDK features

Root Cause

All Mapbox Android SDKs depend on a shared Common SDK library. When different SDKs use different versions of the Common SDK, it can lead to compatibility issues and crashes. This is a requirement noted in the Search SDK installation guide.

Resolution Steps

1. Check Common SDK versions

First, identify which version of the Common SDK each of your Mapbox SDKs is using:

  1. Check the release notes for each SDK you're using:

  2. Look for the Common SDK version listed in the dependencies for each release

  3. Compare the versions to identify any discrepancies

2. Find compatible SDK versions

Once you've identified version conflicts:

  1. Determine which Common SDK version you want to target (usually the latest stable version)
  2. Find compatible versions of all your Mapbox SDKs that use the same Common SDK version
  3. Note the compatible SDK versions for the next step

3. Update your dependencies

Update your build.gradle file with compatible SDK versions:

dependencies {
// Example of compatible versions
implementation 'com.mapbox.search:mapbox-search-android:1.0.0-rc.6'
implementation 'com.mapbox.maps:android:10.14.0'
implementation 'com.mapbox.navigation:android:2.15.0'

// Make sure all use the same Common SDK version
}

4. Clean and rebuild

After updating dependencies:

  1. Clean your project: ./gradlew clean
  2. Rebuild your project: ./gradlew build
  3. Test thoroughly to make sure the crash is resolved

Prevention

To avoid this issue in the future:

  • Check compatibility before updating: Always verify that SDK updates are compatible with your other Mapbox dependencies
  • Update together: When possible, update all Mapbox SDKs at the same time to make sure they use the same Common SDK version
  • Check release notes: Stay informed about Common SDK version requirements when new SDK versions are released
Was this page helpful?