Switch branches/tags
Find file History
Failed to load latest commit information.
MapboxGLAndroidSDK [android] - use uncoverted bearing value for latlngbounds calculation Aug 13, 2018
MapboxGLAndroidSDKLint [android] using @keep annotation across the project with the help of … Jul 26, 2018
MapboxGLAndroidSDKTestApp Fix to textureview transparent background testapp activity (#12605) Aug 14, 2018
art/tests update test documentation adding how to run firebase tests within and… Mar 30, 2017
gradle changed version of mapbox services to 3.4.1 (#12594) Aug 9, 2018
mbgl/gl [core] Make the OpenGL implementation platform specific Oct 25, 2017
resources [android] #4396 - new images for UserLocationView Apr 23, 2016
scripts [build] Push binary size history to S3 (#12538) Aug 6, 2018
src WIP: use expected<T, E> for passing on errors Aug 15, 2018
tests [android] update docs replacing bitrise mentions with circleci Aug 18, 2017
.gitignore [android] Remove support for Fabric (#12126) Jun 12, 2018
CHANGELOG.md [core] Fix querying for annotations near tile boundaries at high zoom. Aug 14, 2018
DISTRIBUTE.md Wrong Typo for BUILDTYPE Feb 5, 2018
LICENSE.md [android] - fix Android licenses formatting Jun 18, 2018
README.md Update README.md (#11408) Mar 7, 2018
TESTS.md update test documentation adding how to run firebase tests within and… Mar 30, 2017
build.gradle [android] - bump used gradle tools version Jul 17, 2018
checkstyle.xml [android] add line starts with a semicolon and empty statement checks… Mar 1, 2017
config.cmake WIP: use expected<T, E> for passing on errors Aug 15, 2018
gradlew [android] - update gradle wrapper and gradle plugin (#7381) Dec 12, 2016
gradlew.bat [android] - update gradle wrapper and gradle plugin (#7381) Dec 12, 2016
settings.gradle [android] using @keep annotation across the project with the help of … Jul 26, 2018
version-script [android] Link with a version script to restrict symbol visibility Mar 14, 2017


Mapbox Maps SDK for Android

Circle CI build status

A library based on Mapbox GL Native for embedding interactive map views with scalable, customizable vector maps onto Android devices.

Getting Started

Alright. So, actually, you may be in the wrong place. From here on in, this README is going to be for people who are interested in working on and improving on Mapbox GL Native for Android.

To view our current API documentation, see our JavaDoc.

To install and use the Mapbox Maps SDK for Android in an application, see the Mapbox Maps SDK for Android website.

Setup environment

These instructions are for developers interested in making code-level contributions to the SDK itself. If you instead want to use the SDK in your app, see above.

Getting the source

Clone the git repository

git clone git@github.com:mapbox/mapbox-gl-native.git && cd mapbox-gl-native

Installing dependencies

These dependencies are required for all operating systems and all platform targets.

  • Latest stable Android Studio
  • Update the Mapbox Maps SDK for Android with the latest
    • Android SDK Build-Tools
    • Android Platform-Tools
    • Android SDK Tools
    • CMake
    • NDK
    • LLDB
  • Modern C++ compiler that supports -std=c++14*
    • clang++ 3.5 or later or
    • g++-4.9 or later
  • Node.js
    • make sure npm is installed as well
  • ccache (optional)

Note: We partially support C++14 because GCC 4.9 does not fully implement the final draft of the C++14 standard. More information in DEVELOPING.md.

Note: On macOS you can install clang with installing the Apple command line developer tools.

Opening the project


Execute the following command in this repository's root folder to generate the required build files and open the project with Android Studio:

make aproj


run make android-configuration in the root folder of the project and open the Android Studio project in /platform/android.

If you are using Arch Linux, install ncurses5-compat-libs.

Project configuration

Setup Checkstyle

Mapbox uses specific IDE settings related to code and check style. See checkstyle guide for configuration details.

Setting Mapbox Access Token

The test application (used for development purposes) uses Mapbox vector tiles, which require a Mapbox account and API access token. Obtain a free access token on the Mapbox account page.

With the first gradle invocation, gradle will take the value of the MAPBOX_ACCESS_TOKEN environment variable and save it to MapboxGLAndroidSDKTestApp/src/main/res/values/developer-config.xml. If the environment variable wasn't set, you can edit developer-config.xml manually and add your access token to the mapbox_access_token resource.

Running project

Run the configuration for the MapboxGLAndroidSDKTestApp module and select a device or emulator to deploy on. Based on the selected device, the c++ code will be compiled for the related processor architecture. You can see the project compiling in the View > Tool Windows > Gradle Console.

More information about building and distributing this project in DISTRIBUTE.md.

Additional resources

Using the SDK snapshot

Instead of using the latest stable release of the Maps SDK for Android, you can use a "snapshot" or the beta version if there is one available. Our snapshots are built every time a Github pull request adds code to this repository's master branch. If you'd like to use a snapshot build, your Android project's gradle file should have -SNAPSHOT appended to the SDK version number. For example, the 5.2.0-SNAPSHOT would look like:

// Mapbox SDK dependency
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.2.0-SNAPSHOT'

You also need to have the section below in your build.gradle root folder to be able to resolve the SNAPSHOT dependencies:

allprojects {
    repositories {
        maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }

Symbolicating native crashes

When hitting native crashes you can use ndk-stack to symbolicate crashes. More information in this guide.