1

I am creating an application to add the facebook like button, i'm using Facebook SDK version 3.19.1, and Android Studio 0.86, the problem is that in the layout not implement com.facebook.widget.LikeView. The error is The following classes could not be found: - com.facebook.widget.LikeView

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MyActivity">


<com.facebook.widget.LikeView
    android:id="@+id/like"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:text="Like"></com.facebook.widget.LikeView>

`

The library is add in my project, for add library, i used this guide Android Studio 0.8.1 - how to use Facebook SDK?

Community
  • 1
  • 1
Bu56
  • 27
  • 4
  • Either facebook has changed the name of the likeview, you have misspelled it or you have actually not added the library properly. You may have missed something when trying to add it. Check if the names are correct and then see other ways to add it. – David Olsson Oct 22 '14 at 12:06
  • No, the name is correct, and the library is correct, why the function com.facebook.widget.loginbutton run properly – Bu56 Oct 23 '14 at 09:03
  • @Bu56 LikeView for facebook was introduced recently try using the latest SDK for android which is v3.21.1 from here https://developers.facebook.com/docs/android – Syn3sthete Jan 06 '15 at 12:09
  • Yes, thanks @ syn3sthete – Bu56 Mar 18 '15 at 11:27

2 Answers2

1

I think you have not properly added the facebook library :-

Right click your project ->Java build path -> Order and Export and make sure the facebook library is checked.

Also, make sure under Android dependencies > facebooksdk.jar, that you see com.facebook.widget.LoginButton.

If it's still not working, try deleting the facebook library, re-adding it, close and restart Eclipse.

user3173628
  • 182
  • 5
  • Yes, the library is correct, and the example to com.facebook.widget.LoginButton run properly – Bu56 Oct 23 '14 at 09:05
0

Try to add xmlns:facebook="http://schemas.android.com/apk/res-auto" to a RelativeLayout