android facebook sdk 4.1.2 eclipse错误

android facebook sdk 4.1.2 eclipse error

这是我在 运行 App 后的错误。导入 Facebook 4.1.2 项目后,它说我需要 Java 1.7,android 支持 v4 和 Bolts-Android 所以我从上一个版本更新了我的 Android 工具库,它是显示错误。

05-18 19:05:06.591: E/AndroidRuntime(23525): FATAL EXCEPTION: main
    05-18 19:05:06.591: E/AndroidRuntime(23525): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fbtest/com.example.fbtest.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.ActivityThread.access0(ActivityThread.java:169)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1388)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.os.Handler.dispatchMessage(Handler.java:107)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.os.Looper.loop(Looper.java:194)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.ActivityThread.main(ActivityThread.java:5433)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at java.lang.reflect.Method.invokeNative(Native Method)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at java.lang.reflect.Method.invoke(Method.java:525)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at dalvik.system.NativeStart.main(Native Method)
    05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.Activity.setContentView(Activity.java:1895)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at com.example.fbtest.MainActivity.onCreate(MainActivity.java:23)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.Activity.performCreate(Activity.java:5179)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    ... 11 more
    05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.login.widget.LoginButton" on path: DexPathList[[zip file "/data/app/com.example.fbtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.fbtest-2, /vendor/lib, /system/lib, /data/datalib]]
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    05-18 19:05:06.591: E/AndroidRuntime(23525):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)

xml 和清单的图像是:

XML,MANIFEST

要消除此错误,首先将您的 Facebook SDK 放入您的工作区,然后导入到 eclipse 中。