android facebook sdk 4.1.2 eclipse错误

时间:2015-05-19 04:40:56

标签: android eclipse facebook facebook-sdk-4.0

这是我运行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.access$600(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和manifest的图片是:

XMLMANIFEST

1 个答案:

答案 0 :(得分:0)

要删除此错误,请首先将Facebook SDK放在工作区中,然后在eclipse中导入。