Skip to main content

Installation

This guide will help you install and configure @rnmapbox/maps for iOS, Android, and Expo projects.

Prerequisites

Step 1: Install the Package

Install @rnmapbox/maps using your preferred package manager:
npm install @rnmapbox/maps

Step 2: Platform-Specific Setup

Choose your platform for detailed setup instructions:

iOS Configuration

After installing the package, you need to configure your iOS project.

Update Podfile

Add the following hooks to your ios/Podfile:
pre_install do |installer|
  $RNMapboxMaps.pre_install(installer)
  # ... other pre install hooks
end

post_install do |installer|
  $RNMapboxMaps.post_install(installer)
  # ... other post install hooks
end

Install Pods

Navigate to the iOS directory and install dependencies:
cd ios
pod install
cd ..

Add Location Permissions (Optional)

If you want to show the user’s location with the UserLocation or LocationPuck component, add location permissions to your ios/Info.plist:
<key>NSLocationWhenInUseUsageDescription</key>
<string>Show current location on map.</string>
See Mapbox iOS documentation for more details on location permissions.

Custom Mapbox Version (Optional)

To use a specific Mapbox SDK version, add this to the top of your Podfile:
$RNMapboxMapsVersion = '= 11.18.2'
If you set a custom version, make sure to update it when upgrading @rnmapbox/maps to avoid compatibility issues.

Step 3: Verify Installation

Verify your installation by running your app:
npm run ios
# or
yarn ios

Troubleshooting

iOS: Pod Install Fails After Upgrade

If you see an error like could not find compatible versions for pod "MapboxMaps", run:
cd ios
pod update MapboxMaps
cd ..

Android: Maven Repository Issues

Ensure the Mapbox Maven repository is added after other repositories in your build.gradle.

Expo: Module Not Found

Make sure you’ve run npx expo prebuild after adding the plugin to regenerate native code.

Supported Versions

  • Package Version: 10.3.0-rc.0
  • Mapbox iOS SDK: ~> 11.18.2
  • Mapbox Android SDK: 11.18.2
  • React Native: 0.79+
  • Node.js: 22.16.0 (recommended)

Next Steps

Quickstart Guide

Create your first map

Set Access Token

Configure your Mapbox token

Build docs developers (and LLMs) love