Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error parsing xml: Unbound prefix with the Facebook SDK

My project doesn't recognizes com.facebook.widget.ProfilePictureView (or another widget) in my xml. I imported the facebook sdk and even used it to log in and interact with open graph. That all worked and I just simply wanted to add a profile picture so ended up using this widget in the sdk.

I tried copying the facebooksdk.jar to my libs folder and add it to the build path but still the unbound prefix error.

My project properties also show a green check next to the facebook sdk library.

How can I use the widgets declared in the facebook sdk lib?

<com.facebook.widget.ProfilePictureView <--- unbound here
            android:id="@+id/selection_profile_pic"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_gravity="center"
            android:gravity="center_horizontal"
            facebook:preset_size="small" />

EDIT

Here is the entire xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <TextView 
        android:id="@+id/name"
        style="@style/DetailText" 
        android:layout_marginTop="35sp"
        android:textIsSelectable="true"/>

    <com.facebook.widget.ProfilePictureView
            android:id="@+id/selection_profile_pic"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:layout_gravity="center"
            android:gravity="center_horizontal"
            facebook:preset_size="small" 
            android:layout_below="@id/name" />

    <Button 
        android:id="@+id/save"
        android:layout_centerHorizontal="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/name"
        android:text="@string/detailview_save"
        android:drawableTop="@drawable/detailview_button_favorieten"
        android:background="@color/light_blue"/>

    <Button 
        android:id="@+id/facebook"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toLeftOf="@id/save"
        android:layout_below="@id/name"
        android:layout_marginRight="10sp"
        android:text="@string/detailview_facebook"
        android:drawableTop="@drawable/detailview_button_delen"
        android:background="@color/light_blue"/>

    <Button 
        android:id="@+id/call"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_toRightOf="@id/save"
        android:layout_below="@id/name"
        android:layout_marginLeft="10sp"
        android:text="@string/detailview_call"
        android:drawableTop="@drawable/detailview_button_bellen"
        android:background="@color/light_blue"/>

    <TextView 
        android:id="@+id/website"
        style="@style/DetailText" 
        android:layout_below="@+id/save"
        android:layout_centerHorizontal="true"
        android:textIsSelectable="true"/>

    <TextView 
        android:id="@+id/address"
        style="@style/DetailText"
        android:layout_below="@+id/website"
        android:layout_centerHorizontal="true"
        android:textIsSelectable="true"/>

    <TextView 
        android:id="@+id/description1"
        style="@style/DetailActivityText" 
        android:layout_below="@+id/address"
        android:layout_centerHorizontal="true"
        android:textIsSelectable="true"/>

    <TextView 
        android:id="@+id/description2"
        style="@style/DetailActivityText" 
        android:layout_below="@+id/description1"
        android:layout_centerHorizontal="true"
        android:textIsSelectable="true"/>

    <TextView 
        android:id="@+id/description3"
        style="@style/DetailActivityText" 
        android:layout_below="@+id/description2"
        android:layout_centerHorizontal="true"
        android:textIsSelectable="true"/>

    <TextView 
        android:id="@+id/description4"
        style="@style/DetailActivityText"
        android:layout_below="@+id/description3"
        android:layout_centerHorizontal="true"
        android:textIsSelectable="true"/>

    <TextView 
        android:id="@+id/description5"
        style="@style/DetailActivityText"
        android:layout_below="@+id/description4"
        android:layout_centerHorizontal="true"
        android:textIsSelectable="true"/>


</RelativeLayout>
like image 303
Mark Molina Avatar asked Mar 28 '13 10:03

Mark Molina


1 Answers

Try adding the facebook XMLNS to you layout:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:facebook="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
like image 156
Raghav Sood Avatar answered Nov 07 '22 16:11

Raghav Sood