Error compile in "Use Facebook Login example" Error compile in "Use Facebook Login example" android android

Error compile in "Use Facebook Login example"


May you forgot to define Activity in your AndroidManifest.xml

<activity    android:name="com.facebook.LoginActivity"    android:label="@string/title_facebook_login" ></activity>


I had the same problem and it was because I forgot to add the com.facebook.LoginActivity activity to AndroidManifest.xml.

Also check that you followed the steps on the "Create a new Android Project with Facebook Login" section on https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/ , specially those regarding adding the app_id string to res/values/strings.xml, the INTERNET permission, the com.facebook.sdk.ApplicationId Meta Data, and finally the mentioned LoginActivity.


While the original question is related to SDK 3.0 I think it's worth mentioning that in SDK v4.0.+ the activity that needs to be declared in the AndroidManifest.xml is com.facebook.FacebookActivity eg:

<activity android:name="com.facebook.FacebookActivity"    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"    android:theme="@android:style/Theme.Translucent.NoTitleBar"    android:label="@string/app_name" />