Error : Facebook SDK AndroidRuntime﹕FATAL EXCEPTION: main


Posted on : Thu, 7th May 15 07:59 am UTC
100+ votes
Logs LogCat
05-07 12:52:36.018  23128-23128/org.code2care.fbloginwithandroidsdk E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: org.code2care.fbloginwithandroidsdk, PID: 23128
    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:4646)
            at android.view.View$PerformClick.run(View.java:19403)
            at android.os.Handler.handleCallback(Handler.java:733)
            at android.os.Handler.dispatchMessage(Handler.java:95)
            at android.os.Looper.loop(Looper.java:146)
            at android.app.ActivityThread.main(ActivityThread.java:5511)
            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:1283)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
            at dalvik.system.NativeStart.main(Native Method)

One of the reason of this issue can be the declaration of Facebook Activity in AndroidManifest.xml file is being missed.

snippet Language : xml
 <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" />

Make sure that this tag exists in your Manifest.

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +