Android SDK Facebook登录按钮错误

时间:2015-10-14 16:16:41

标签: android facebook sdk

我正在尝试在我的Android应用程序中安装Facebook登录按钮。我正在使用AndroidSDK并收到以下错误:

10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime: FATAL EXCEPTION: main
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime: Process: com.example.frederik.testpleasework, PID: 2218
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.frederik.testpleasework/com.example.frederik.testpleasework.MainActivity}: android.view.InflateException: Binary XML file line #18: Binary XML file line #12: Error inflating class com.facebook.login.widget.LoginButton
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:  Caused by: android.view.InflateException: Binary XML file line #18: Binary XML file line #12: Error inflating class com.facebook.login.widget.LoginButton
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:255)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.example.frederik.testpleasework.MainActivity.onCreate(MainActivity.java:19)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:  Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class com.facebook.login.widget.LoginButton
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:645)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.parseInclude(LayoutInflater.java:971)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:831)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:255) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.example.frederik.testpleasework.MainActivity.onCreate(MainActivity.java:19) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:  Caused by: java.lang.reflect.InvocationTargetException
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at java.lang.reflect.Constructor.newInstance(Native Method)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:619)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.parseInclude(LayoutInflater.java:971) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:831) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:255) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.example.frederik.testpleasework.MainActivity.onCreate(MainActivity.java:19) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:  Caused by: The SDK has not been initialized, make sure to call FacebookSdk.sdkInitialize() first.
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.facebook.internal.Validate.sdkInitialized(Validate.java:136)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.facebook.AccessTokenTracker.<init>(AccessTokenTracker.java:55)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.facebook.login.widget.LoginButton$2.<init>(LoginButton.java:561)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.facebook.login.widget.LoginButton.configureButton(LoginButton.java:561)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.facebook.FacebookButtonBase.<init>(FacebookButtonBase.java:66)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.facebook.login.widget.LoginButton.<init>(LoginButton.java:200)
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at java.lang.reflect.Constructor.newInstance(Native Method) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:764) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:835) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.parseInclude(LayoutInflater.java:971) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:831) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:255) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.example.frederik.testpleasework.MainActivity.onCreate(MainActivity.java:19) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.Activity.performCreate(Activity.java:6237) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.-wrap11(ActivityThread.java) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:102) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:148) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5417) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) 
10-14 16:08:24.733 2218-2218/com.example.frederik.testpleasework E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 

我已经使用他们的表单进行了设置: enter image description here

(插入所有其他信息,但我相信这是相关的)

有一个想法错误可能在我的清单中,我将提供以及:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.frederik.testpleasework" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

在清理互联网寻找解决方案后,我自己对错误的看法可能是FB页面上的错误设置或清单中的错误代码。但是我没有设法找到它,希望你们能帮忙。

提前谢谢=)

1 个答案:

答案 0 :(得分:0)

我认为以下内容会对您有所帮助。 1)在super.on创建之后,将你的Facebook代码初始化。在setcontent视图之前。

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        FacebookSdk.sdkInitialize(getApplicationContext());
        setContentView(R.layout.activity_main);
}

2)其次你没有在清单中定义facebook活动。

 <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" />

3)同时在清单

中添加facebbok app id的元数据
 <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fbid"/>

你表现出来应该是这样的:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.solution.sa.myfb" >

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >
        <activity android:name=".MainActivity" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <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" />

        <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fbid"/>

    </application>



</manifest>

仍然有任何问题,请随时问: - )

enter image description here

您可以在字符串类中添加您的Facebook ID:

 <string name="fbid">your fb id</string>

为您提供帮助的图片