Search code examples
androidandroid-studiomaplibre-gl

Adding MapLibre to a new Android project is not working


I am following the documentation to add the MapLiber library to a new Android project https://maplibre.org/maplibre-native/docs/book/android/getting-started-guide.html

The Gradle sync seems to be working ok, but I get this error when trying to import the package

import org.maplibre.android.Maplibre

Unresolved reference: maplibre

this is how I added the dependency

implementation 'org.maplibre.gl:android-sdk:10.0.2'

What am i doing wrong?


Solution

  • There is a problem with the documentation. You can init like that:

    import com.mapbox.mapboxsdk.Mapbox;
    
           Mapbox.getInstance(this);
    

    enter image description here