启动Facebook Android应用程序时运行时错误

时间:2013-08-09 17:23:22

标签: android facebook

我正在按照https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/

提供的教程

在尝试使用第6部分中给出的Facebook登录创建Android项目时,我遇到了LogCat中显示的以下错误:

08-09 15:48:56.556: I/dalvikvm(378): Could not find method com.facebook.Session.getActiveSession, referenced from method com.example.myfirstandroidapplication.MainActivity.onActivityResult
08-09 15:48:56.576: W/dalvikvm(378): VFY: unable to resolve static method 27: Lcom/facebook/Session;.getActiveSession ()Lcom/facebook/Session;
08-09 15:48:56.576: D/dalvikvm(378): VFY: replacing opcode 0x71 at 0x0003
08-09 15:48:56.576: D/dalvikvm(378): VFY: dead code 0x0006-000a in Lcom/example/myfirstandroidapplication/MainActivity;.onActivityResult (IILandroid/content/Intent;)V
08-09 15:48:56.586: I/dalvikvm(378): Failed resolving Lcom/example/myfirstandroidapplication/MainActivity$1; interface 25 'Lcom/facebook/Session$StatusCallback;'
08-09 15:48:56.586: W/dalvikvm(378): Link of class 'Lcom/example/myfirstandroidapplication/MainActivity$1;' failed
08-09 15:48:56.586: E/dalvikvm(378): Could not find class 'com.example.myfirstandroidapplication.MainActivity$1', referenced from method com.example.myfirstandroidapplication.MainActivity.onCreate
08-09 15:48:56.586: W/dalvikvm(378): VFY: unable to resolve new-instance 10 (Lcom/example/myfirstandroidapplication/MainActivity$1;) in Lcom/example/myfirstandroidapplication/MainActivity;
08-09 15:48:56.586: D/dalvikvm(378): VFY: replacing opcode 0x22 at 0x0009
08-09 15:48:56.636: D/dalvikvm(378): VFY: dead code 0x000b-0010 in Lcom/example/myfirstandroidapplication/MainActivity;.onCreate (Landroid/os/Bundle;)V
08-09 15:48:56.717: D/AndroidRuntime(378): Shutting down VM
08-09 15:48:56.717: W/dalvikvm(378): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-09 15:48:56.736: E/AndroidRuntime(378): FATAL EXCEPTION: main
08-09 15:48:56.736: E/AndroidRuntime(378): java.lang.NoClassDefFoundError: com.example.myfirstandroidapplication.MainActivity$1
08-09 15:48:56.736: E/AndroidRuntime(378):  at com.example.myfirstandroidapplication.MainActivity.onCreate(MainActivity.java:28)
08-09 15:48:56.736: E/AndroidRuntime(378):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-09 15:48:56.736: E/AndroidRuntime(378):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-09 15:48:56.736: E/AndroidRuntime(378):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-09 15:48:56.736: E/AndroidRuntime(378):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-09 15:48:56.736: E/AndroidRuntime(378):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-09 15:48:56.736: E/AndroidRuntime(378):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-09 15:48:56.736: E/AndroidRuntime(378):  at android.os.Looper.loop(Looper.java:123)
08-09 15:48:56.736: E/AndroidRuntime(378):  at android.app.ActivityThread.main(ActivityThread.java:4627)
08-09 15:48:56.736: E/AndroidRuntime(378):  at java.lang.reflect.Method.invokeNative(Native Method)
08-09 15:48:56.736: E/AndroidRuntime(378):  at java.lang.reflect.Method.invoke(Method.java:521)
08-09 15:48:56.736: E/AndroidRuntime(378):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-09 15:48:56.736: E/AndroidRuntime(378):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-09 15:48:56.736: E/AndroidRuntime(378):  at dalvik.system.NativeStart.main(Native Method)
08-09 16:22:11.456: I/dalvikvm(402): Could not find method com.facebook.Session.getActiveSession, referenced from method com.example.myfirstandroidapplication.MainActivity.onActivityResult
08-09 16:22:11.456: W/dalvikvm(402): VFY: unable to resolve static method 27: Lcom/facebook/Session;.getActiveSession ()Lcom/facebook/Session;
08-09 16:22:11.466: D/dalvikvm(402): VFY: replacing opcode 0x71 at 0x0003
08-09 16:22:11.466: D/dalvikvm(402): VFY: dead code 0x0006-000a in Lcom/example/myfirstandroidapplication/MainActivity;.onActivityResult (IILandroid/content/Intent;)V
08-09 16:22:11.476: I/dalvikvm(402): Failed resolving Lcom/example/myfirstandroidapplication/MainActivity$1; interface 25 'Lcom/facebook/Session$StatusCallback;'
08-09 16:22:11.476: W/dalvikvm(402): Link of class 'Lcom/example/myfirstandroidapplication/MainActivity$1;' failed
08-09 16:22:11.507: E/dalvikvm(402): Could not find class 'com.example.myfirstandroidapplication.MainActivity$1', referenced from method com.example.myfirstandroidapplication.MainActivity.onCreate
08-09 16:22:11.507: W/dalvikvm(402): VFY: unable to resolve new-instance 10 (Lcom/example/myfirstandroidapplication/MainActivity$1;) in Lcom/example/myfirstandroidapplication/MainActivity;
08-09 16:22:11.507: D/dalvikvm(402): VFY: replacing opcode 0x22 at 0x0009
08-09 16:22:11.507: D/dalvikvm(402): VFY: dead code 0x000b-0010 in Lcom/example/myfirstandroidapplication/MainActivity;.onCreate (Landroid/os/Bundle;)V
08-09 16:22:11.696: D/AndroidRuntime(402): Shutting down VM
08-09 16:22:11.706: W/dalvikvm(402): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-09 16:22:11.716: E/AndroidRuntime(402): FATAL EXCEPTION: main
08-09 16:22:11.716: E/AndroidRuntime(402): java.lang.NoClassDefFoundError: com.example.myfirstandroidapplication.MainActivity$1
08-09 16:22:11.716: E/AndroidRuntime(402):  at com.example.myfirstandroidapplication.MainActivity.onCreate(MainActivity.java:28)
08-09 16:22:11.716: E/AndroidRuntime(402):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-09 16:22:11.716: E/AndroidRuntime(402):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
08-09 16:22:11.716: E/AndroidRuntime(402):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-09 16:22:11.716: E/AndroidRuntime(402):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-09 16:22:11.716: E/AndroidRuntime(402):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-09 16:22:11.716: E/AndroidRuntime(402):  at android.os.Handler.dispatchMessage(Handler.java:99)
08-09 16:22:11.716: E/AndroidRuntime(402):  at android.os.Looper.loop(Looper.java:123)
08-09 16:22:11.716: E/AndroidRuntime(402):  at android.app.ActivityThread.main(ActivityThread.java:4627)
08-09 16:22:11.716: E/AndroidRuntime(402):  at java.lang.reflect.Method.invokeNative(Native Method)
08-09 16:22:11.716: E/AndroidRuntime(402):  at java.lang.reflect.Method.invoke(Method.java:521)
08-09 16:22:11.716: E/AndroidRuntime(402):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-09 16:22:11.716: E/AndroidRuntime(402):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-09 16:22:11.716: E/AndroidRuntime(402):  at dalvik.system.NativeStart.main(Native Method)

我也尝试了所有可能的搜索,并尝试解析库依赖关系,但仍然无法摆脱此错误。

我还附上了facebook sdk参考错误的屏幕截图,如果它可以帮助你建议我一个解决方案。1

如果在另一个帖子中有解决此问题的方法,请将我引导至该链接。

0 个答案:

没有答案