com.facebook.widget.ProfilePictureView - 错误:解析XML时出错:未绑定的前缀 [英] com.facebook.widget.ProfilePictureView - error: Error parsing XML: unbound prefix

查看:133
本文介绍了com.facebook.widget.ProfilePictureView - 错误:解析XML时出错:未绑定的前缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是的,我有这个错误在

 < com.facebook.widget.ProfilePictureView 

行和这是一个在stackoverflow上被多次提出的问题,每次似乎已经被在顶部添加xmlns:fb =http://schemas.android.com/apk/res-auto。那么没有为我解决,不知道为什么:(所以我该怎么办?

 <? xml version =1.0encoding =utf-8?> 
< LinearLayout xmlns:android =http://schemas.android.com/apk/res/android
xmlns: fb =http://schemas.android.com/apk/res-auto
android:layout_width =wrap_content
android:layout_height =wrap_content
android:layout_marginTop = 20dp
android:gravity =center_horizo​​ntal
android:orientation =horizo​​ntal>

< com.facebook.widget.ProfilePictureView
android:id =@ + id / selection_profile_pic
android:layout_width =wrap_content
android:layout_height =wrap_content
android:layout_gravity =center
android:gravity =
app:is_cropped =true
facebook:preset_size =small/>
< / LinearLayout>

我也尝试过

  xmlns:facebook =http://schemas.android.com/apk/res/com.facebook.samples.profilepicture

但没有工作



这是我的project.properties文件:

  target = android-18 
android.library = false
android.library.reference.1 = .. \\actionbarsherlock
android.library .reference.2 = .. \\library
android.library.reference.3 = .. / facebook-android-sdk-3.6.0 / facebook
/ pre>

尝试将其更改为

  target = android-18 
android.library = false
android.library.reference.1 = .. \\actionbarsherlock
android.library.reference.2 = .. \\library
android.library.reference.3 = .. \\facebook-android-sdk-3.6.0\facebook

但没有结果



解决方案

您的XML中有两个错误。



1)您没有声明命名空间app



2)您已经声明了命名空间 xmlns:fb =http://schemas.android.com/apk/res-auto,但您将其称为Facebook,即facebook:preset_size



您可以通过



来修复此问题1)为app添加命名空间声明,即 xmlns:app =http://schemas.android .com / apk / res-auto



2)将fb命名空间声明重命名为facebook,即 xmlns: http://schemas.android.com/apk/res-auto


Yes I have this error at the

<com.facebook.widget.ProfilePictureView 

line and this is a question that has been asked numerous times on stackoverflow, and every time it seems it has been fixed by adding xmlns:fb="http://schemas.android.com/apk/res-auto" at the top. Well that didnt solve it for me, dont know why :( So what do I do?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fb="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp"
    android:gravity="center_horizontal"
    android:orientation="horizontal" >

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

I also tried

xmlns:facebook="http://schemas.android.com/apk/res/com.facebook.samples.profilepicture"

but didnt work as well

This is my project.properties file:

target=android-18
android.library=false
android.library.reference.1=..\\actionbarsherlock
android.library.reference.2=..\\library
android.library.reference.3=../facebook-android-sdk-3.6.0/facebook

tried changing it to

target=android-18
android.library=false
android.library.reference.1=..\\actionbarsherlock
android.library.reference.2=..\\library
android.library.reference.3=..\\facebook-android-sdk-3.6.0\facebook

but no results either

解决方案

You have two errors in your XML.

1) you have not declared the namespace "app"

2) you have declared the namespace xmlns:fb="http://schemas.android.com/apk/res-auto" but you are refering it as "facebook" i.e. facebook:preset_size

you can fix this by

1) Adding a namespace declaration for "app" i.e. xmlns:app="http://schemas.android.com/apk/res-auto"

2) renaming your "fb" namespace declaration to "facebook" i.e. xmlns:facebook="http://schemas.android.com/apk/res-auto"

这篇关于com.facebook.widget.ProfilePictureView - 错误:解析XML时出错:未绑定的前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆