4

I tried following the intstructions for adding a facebook login for my app. https://developers.facebook.com/docs/facebook-login/android/v2.2

I did the step for Add the Login Button.

It displays properly on my screen however I get the following error when I click it:

Process: com.parse.starter, PID: 3073
    Log in attempt failed: LoginActivity could not be started
            at com.facebook.login.LoginManager.startLogin(LoginManager.java:382)
            at com.facebook.login.LoginManager.logInWithReadPermissions(LoginManager.java:262)
            at com.facebook.login.widget.LoginButton$LoginClickListener.onClick(LoginButton.java:693)
            at com.facebook.FacebookButtonBase$1.onClick(FacebookButtonBase.java:310)
            at android.view.View.performClick(View.java:4438)
            at android.view.View$PerformClick.run(View.java:18422)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)

Do I need to handle user clicks in my code. Somehow I thought this was inbuilt in the button. Thanks for the help.

2
  • 2
    Add loginactivity to your manifest Mar 29, 2015 at 21:13
  • 1
    @RobertRowntree, I suggest you expand on this and add it as answer.
    – ifaour
    Apr 2, 2015 at 11:59

1 Answer 1

16

For Facebook SDK 4+, you need the following in your manifest:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.