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
Step 1: Check Common SDK version compatibility.
First, identify which version of the Common SDK each of your Mapbox SDKs is using.
If you are using any Search SDK v2.18.0+, Navigation SDK v3.18.0+ and/or Maps SDK v3.18.0+, you will need to check that the sub-versions match.
- For example if you using the Search SDK v2.19.1, make sure you are using Navigation SDK v3.19.1 and Maps SDK v3.19.1. If you have inconsistent sub-versions users may experience issues.
If you are using any Search SDK v2.16.0 or older, Navigation SDK/Maps SDK v3.16.0 or older, you will need to check the related release notes to check the compatible versions:
Step 2: Update your dependencies
Update your build.gradle file with compatible SDK versions, you determined in the prior step:
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
}
Step 3: Clean and rebuild
After updating dependencies:
- Clean your project:
./gradlew clean - Rebuild your project:
./gradlew build - 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
Related resources
- Search SDK Installation Guide
- Maps SDK for Android Installation
- Navigation SDK for Android Installation