Rakeeb Rajbhandari Rakeeb Rajbhandari - 5 months ago 78
Android Question

Error parsing XML: unbound prefix on library

I am using three libraries in my project:

a. ViewPager
b. SherlockActionBar
c. PagerSlidingTabStrip


In my layout xml, I am getting the following
error parsing XML
in here:

<com.astuetz.viewpager.extensions.PagerSlidingTabStrip
android:id="@+id/strips"
android:layout_width="match_parent"
android:layout_height="48dip"
app:indicatorColor="#FF9326"
app:textAllCaps="false" />


I implemented the library same as the two other libraries used in the project. The other two libraries are running smoothly. Error only exists within this. Please help.

Full layout xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainSlider" >

<com.astuetz.viewpager.extensions.PagerSlidingTabStrip
android:id="@+id/strips"
android:layout_width="match_parent"
android:layout_height="48dip"
app:indicatorColor="#FF9326"
app:textAllCaps="false" />

<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />

</LinearLayout>


I have already tried cleaning the project, re-adding library to the workspace, etc.

Answer

Try to add custom properties reference using res-auto xmlns schemas

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainSlider" >

    <com.astuetz.viewpager.extensions.PagerSlidingTabStrip
        android:id="@+id/strips"
        android:layout_width="match_parent"
        android:layout_height="48dip"
        app:indicatorColor="#FF9326"
        app:textAllCaps="false" />

    <android.support.v4.view.ViewPager
        android:id="@+id/pager"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

</LinearLayout>
Comments