【问题标题】:Multiple annotations found at this line: - error: No resource identifier found for attribute 'fetch_user_info' in package在此行找到多个注释:-错误:在包中找不到属性“fetch_user_info”的资源标识符
【发布时间】:2015-08-11 19:22:32
【问题描述】:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
    android:gravity="center_horizontal"
    android:orientation="vertical"
    android:padding="20dp" >

    <com.facebook.login.widget.LoginButton

        android:id="@+id/fb_login_button"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        facebook:confirm_logout="false"
        facebook:fetch_user_info="true" />

    <TextView
        android:id="@+id/user_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_margin="10dp"
        android:textSize="18sp" />

    <Button
        android:id="@+id/update_status"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="update_status" />

    <Button
        android:id="@+id/post_image"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="post_image" />

</LinearLayout>

这是我收到错误的面部登录页面:

- error: No resource identifier found for attribute 'fetch_user_info' in package 
'com.example.facebookexmaple' 
 - error: No resource identifier found for attribute 'confirm_logout' in package 
 'com.example.facebookexmaple'

at <com.facebook.login.widget.LoginButton  

虽然我已经添加了库和 facebook 名称空间,但请告诉我如何修复它。

【问题讨论】:

  • 你为facebook添加了gradle吗?
  • 不,我在 Eclipse 中这样做
  • 它不起作用我也添加了该代码,但这个 xml 错误不会发生

标签: android xml facebook


【解决方案1】:

首先,添加xmlns:fb="http://schemas.android.com/apk/res-auto" 而不是xmlns:facebook="http://schemas.android.com/apk/res-auto"

演示请查看Getting Started with the Facebook SDK for Android

【讨论】:

猜你喜欢
  • 2016-03-15
  • 2015-04-11
  • 2013-12-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多