Error compile in “Use Facebook Login example”

后端 未结 5 2136
广开言路
广开言路 2021-02-03 18:12

I\'m trying to create the Login Application in this tutorial:

I\'m getting this error in my logcat:

11-22 15:57:53.863: E/AndroidRuntime(816): com.facebo         


        
相关标签:
5条回答
  • 2021-02-03 18:52

    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" />
    
    0 讨论(0)
  • 2021-02-03 18:54

    May you forgot to define Activity in your AndroidManifest.xml

    <activity
        android:name="com.facebook.LoginActivity"
        android:label="@string/title_facebook_login" >
    </activity>
    
    0 讨论(0)
  • 2021-02-03 18:58

    https://developers.facebook.com/docs/reference/android/3.0/class/LoginActivity/

    <activity
        android:name="com.facebook.LoginActivity"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Translucent.NoTitleBar">
    </activity>
    
    0 讨论(0)
  • 2021-02-03 19:03

    In this link

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

    is not mentioned.

    Add this in AndroidMainfest.xml and problem solved.

    0 讨论(0)
  • 2021-02-03 19:09

    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.

    0 讨论(0)
提交回复
热议问题