简体   繁体   中英

No resource identifier found for attribute “facebook”

I see study this code

I have exception:

Error:(15) No resource identifier found for attribute 'com_facebook_confirm_logout' in package 'by.polykov.myclientsocialnetwork'
Error:(15) No resource identifier found for attribute 'com_facebook_tooltip_mode' in package 'by.polykov.myclientsocialnetwork'
Error:(38) No resource identifier found for attribute 'com_facebook_preset_size' in package 'by.polykov.myclientsocialnetwork'
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\Android SDK\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1

from

<?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:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFF"
    >
    <LinearLayout android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#FFF"
        android:id="@+id/main_ui_container">
        <com.facebook.login.widget.LoginButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:layout_gravity="center_horizontal"
            facebook:com_facebook_confirm_logout="false"
            facebook:com_facebook_tooltip_mode="never_display"
            />
        <LinearLayout
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:gravity="center_horizontal"
            android:orientation="vertical"
            >
            <TextView
                android:id="@+id/greeting"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_gravity="center"
                android:textColor="#333"
                android:textSize="18sp"/>
            <com.facebook.login.widget.ProfilePictureView
                android:id="@+id/profilePicture"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:gravity="center_horizontal"
                android:layout_marginBottom="10dp"
                facebook:com_facebook_preset_size="normal"/>
            <Button
                android:id="@+id/postStatusUpdateButton"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="Post Status Update"
                />
            <Button
                android:id="@+id/postPhotoButton"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="Post Photo"
                />

        </LinearLayout>
    </LinearLayout>

</LinearLayout>

I use compile 'com.facebook.android:facebook-android-sdk:4.0.0'

What's wrong? Help please

the solution solved by @toni7777 was adding the compile dependency with the latest version of the Facebook SDK :

dependencies { 
    compile 'com.facebook.android:facebook-android-sdk:4.1.0' 
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM