Skip to content Skip to sidebar Skip to footer

Error Parsing Xml: Unbound Prefix For Mapbox

I'm trying to use mapbox in my android application. I use android studio 0.8.0. I've included this line in my build.gradle file compile ('com.mapbox.mapboxsdk:mapbox-android-sd

Solution 1:

You can also fix this error by adding this line in your xml:

xmlns:mapbox="http://schemas.android.com/apk/res-auto"

XML example:

<?xml version="1.0" encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:mapbox="http://schemas.android.com/apk/res-auto"android:layout_width="fill_parent"android:layout_height="fill_parent"
    ><com.mapbox.mapboxsdk.views.MapViewandroid:id="@+id/mapview"android:layout_width="fill_parent"android:layout_height="fill_parent"mapbox:mapid="your id" /></LinearLayout>

Solution 2:

okay finally it is solved. I change my xml file :

<ScrollViewxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="wrap_content"xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/parent_layout"><com.mapbox.mapboxsdk.views.MapViewandroid:id="@+id/mapid"android:focusable="false"android:focusableInTouchMode="false"android:paddingTop="10dp"app:mapid="your map id"android:layout_width="match_parent"android:layout_height="320dp" ></com.mapbox.mapboxsdk.views.MapView></ScrollView>

Post a Comment for "Error Parsing Xml: Unbound Prefix For Mapbox"