Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook login button widget no resource identifer

I have inherited some code and I'm working on it, however, when I try to build it I get the following issue:

activity_login.xml:26: error: No resource identifier found for attribute 'login_text' in package

My button xml is as follows:

<com.facebook.widget.LoginButton
        xmlns:fb="http://schemas.android.com/apk/res-auto"
        android:id="@+id/facebookBtn"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="25dp"
        android:textColor="@color/white"
        android:textAppearance="@android:style/TextAppearance.Small"
        android:gravity="center"
        android:onClick="facebookBtnClick"
        android:paddingLeft="30dp"
        fb:login_text="@string/loginWithFacebook"
        />

I have also tried putting in xmlns:fb="http://schemas.android.com/apk/res/com.facebook.widget" but this didn't work for me either, if anyone has any suggestions I'd greatly appreciate it

like image 794
DJ-DOO Avatar asked Nov 21 '14 13:11

DJ-DOO


1 Answers

You can find info here https://developers.facebook.com/docs/android/upgrading-4.x

Style attr tags are now namespaced to avoid conflicts. Apps will need to add the namespace "com_facebook_" to their existing facebook sdk style attrs.

So, use fb:com_facebook_login_text now.

like image 59
Artem Avatar answered Oct 09 '22 11:10

Artem