找不到方法android.support.v4.content.LocalBroadcastManager.getInstance

时间:2013-08-02 00:30:05

标签: android facebook

我知道这些问题很多,“解决方案”是确保检查Android私有库。在我的情况下,他们,还有其他任何提示吗?应用程序崩溃的最初阶段。

这里是堆栈跟踪

  

08-02 00:22:58.316:E / Trace(4825):错误打开跟踪文件:没有这样的文件或目录(2)

     

08-02 00:22:59.035:W / dalvikvm(4825):VFY:无法找到签名中引用的类(Landroid / support / v4 / app / Fragment;)

     

08-02 00:22:59.035:W / dalvikvm(4825):VFY:无法找到签名中引用的类(Landroid / support / v4 / app / Fragment;)

     

08-02 00:22:59.045:I / dalvikvm(4825):找不到方法android.support.v4.content.LocalBroadcastManager.getInstance,从方法com.facebook.Session.postActiveSessionAction

引用      

08-02 00:22:59.045:W / dalvikvm(4825):VFY:无法解析静态方法187:Landroid / support / v4 / content / LocalBroadcastManager; .getInstance(Landroid / content / Context;)Landroid /支撑/ V4 /内容/ LocalBroadcastManager;

     

08-02 00:22:59.045:D / dalvikvm(4825):VFY:在0x0009处替换操作码0x71

     

08-02 00:22:59.075:D / AndroidRuntime(4825):关闭虚拟机

     

08-02 00:22:59.075:W / dalvikvm(4825):threadid = 1:线程退出未捕获的异常(组= 0x40a71930)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):致命异常:主

     

08-02 00:22:59.095:E / AndroidRuntime(4825):java.lang.NoClassDefFoundError:android.support.v4.content.LocalBroadcastManager

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at com.facebook.Session.postActiveSessionAction(Session.java:1215)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at com.facebook.Session.setActiveSession(Session.java:765)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at com.facebook.Session.openActiveSession(Session.java:865)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at com.facebook.Session.openActiveSession(Session.java:805)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at com.example.firstandroidapp.MainActivity.onCreate(MainActivity.java:22)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.app.Activity.performCreate(Activity.java:5104)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.app.ActivityThread.access $ 600(ActivityThread.java:141)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1234)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.os.Handler.dispatchMessage(Handler.java:99)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.os.Looper.loop(Looper.java:137)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):在android.app.ActivityThread.main(ActivityThread.java:5041)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at java.lang.reflect.Method.invokeNative(Native Method)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at java.lang.reflect.Method.invoke(Method.java:511)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:793)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)

     

08-02 00:22:59.095:E / AndroidRuntime(4825):at dalvik.system.NativeStart.main(Native Method)

1 个答案:

答案 0 :(得分:9)

解决。从一些奇怪的原因,由谷歌预配置的ADT在项目的/ libs目录中附加了相同的文件。当您将facebook SDK添加到类路径时,它也会附加它。问题是他们有不同的版本(和sha-1哈希)所以eclipse有问题该怎么办。我只是删除/ libs目录,它工作。从facebook教程成功运行应用程序。