Overview
This guide covers the Android-specific setup required for@rnmapbox/maps. The SDK supports Mapbox Maps SDK v11 for Android.
Prerequisites
- React Native 0.79 or higher
- Node.js (v22.16.0 recommended)
- Android Studio
- Android SDK with minimum API level 21 (Android 5.0)
- Mapbox access token (see Setup Access Token)
Installation Steps
Add Mapbox Maven repository
Add the Mapbox Maven repository to your
android/build.gradle file:android/build.gradle
Mapbox has removed the authentication requirement for downloads, so you no longer need to configure
MAPBOX_DOWNLOADS_TOKEN.Advanced Configuration
Using a Custom Mapbox SDK Version
You can specify a custom Mapbox Maps SDK version by setting theRNMapboxMapsVersion variable in your android/build.gradle file:
android/build.gradle
Troubleshooting
Duplicate library files error
If you encounter this error:android/app/build.gradle:
android/app/build.gradle
Build fails with “unable to resolve dependency”
- Make sure you’ve added the Mapbox Maven repository to your
android/build.gradle - Check your internet connection
- Try running
./gradlew cleanin theandroiddirectory - Invalidate caches in Android Studio: File > Invalidate Caches / Restart
ProGuard issues
If you’re using ProGuard and encountering crashes, you may need to add ProGuard rules. Check the Mapbox documentation for the latest ProGuard configuration.AndroidX compatibility
This library uses AndroidX. Make sure your project has migrated to AndroidX. In yourgradle.properties:
Next Steps
After completing the Android setup:- Set up your Mapbox access token
- Explore the component documentation
- Check out the example applications
- If you’re also targeting iOS, see the iOS Setup Guide