问题描述
我在做我的项目的Facebook应用程序。
i am doing facebook app in my project.
我跟着这个步骤在这个环节的示例应用程序。
i followed this step the sample app in this link.
现在我在LogCat中得到这个例外。
now i got this exception in my Logcat.
02-20 22:02:29.020: INFO/ActivityManager(58): Starting activity: Intent { cmp=com.example.brown/.Brown_FaceBook }
02-20 22:02:29.409: ERROR/dalvikvm(236): Could not find class 'com.codecarpet.fbconnect.FBPermissionActivity', referenced from method com.example.brown.Brown_FaceBook.askPermission
02-20 22:02:29.418: WARN/dalvikvm(236): VFY: unable to resolve const-class 78 (Lcom/codecarpet/fbconnect/FBPermissionActivity;) in Lcom/example/brown/Brown_FaceBook;
02-20 22:02:29.418: DEBUG/dalvikvm(236): VFY: replacing opcode 0x1c at 0x0002
02-20 22:02:29.428: DEBUG/dalvikvm(236): Making a copy of Lcom/example/brown/Brown_FaceBook;.askPermission code (125 bytes)
02-20 22:02:29.438: INFO/dalvikvm(236): Could not find method com.codecarpet.fbconnect.FBSession.getUid, referenced from method com.example.brown.Brown_FaceBook.checkPermission
02-20 22:02:29.448: WARN/dalvikvm(236): VFY: unable to resolve virtual method 124: Lcom/codecarpet/fbconnect/FBSession;.getUid ()Ljava/lang/Long;
02-20 22:02:29.448: DEBUG/dalvikvm(236): VFY: replacing opcode 0x6e at 0x0009
02-20 22:02:29.457: DEBUG/dalvikvm(236): Making a copy of Lcom/example/brown/Brown_FaceBook;.checkPermission code (112 bytes)
02-20 22:02:29.469: ERROR/dalvikvm(236): Could not find class 'com.codecarpet.fbconnect.FBFeedActivity', referenced from method com.example.brown.Brown_FaceBook.publishFeed
02-20 22:02:29.469: WARN/dalvikvm(236): VFY: unable to resolve const-class 75 (Lcom/codecarpet/fbconnect/FBFeedActivity;) in Lcom/example/brown/Brown_FaceBook;
02-20 22:02:29.478: DEBUG/dalvikvm(236): VFY: replacing opcode 0x1c at 0x0002
02-20 22:02:29.478: DEBUG/dalvikvm(236): Making a copy of Lcom/example/brown/Brown_FaceBook;.publishFeed code (68 bytes)
02-20 22:02:29.497: WARN/dalvikvm(236): Unable to resolve superclass of Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl; (81)
02-20 22:02:29.497: WARN/dalvikvm(236): Link of class 'Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl;' failed
02-20 22:02:29.507: ERROR/dalvikvm(236): Could not find class 'com.example.brown.Brown_FaceBook$FBSessionDelegateImpl', referenced from method com.example.brown.Brown_FaceBook.onCreate
02-20 22:02:29.521: WARN/dalvikvm(236): VFY: unable to resolve new-instance 95 (Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl;) in Lcom/example/brown/Brown_FaceBook;
02-20 22:02:29.528: DEBUG/dalvikvm(236): VFY: replacing opcode 0x22 at 0x0015
02-20 22:02:29.528: DEBUG/dalvikvm(236): Making a copy of Lcom/example/brown/Brown_FaceBook;.onCreate code (292 bytes)
02-20 22:02:29.537: WARN/dalvikvm(236): Unable to resolve superclass of Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl; (81)
02-20 22:02:29.537: WARN/dalvikvm(236): Link of class 'Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl;' failed
02-20 22:02:29.547: ERROR/dalvikvm(236): Could not find class 'com.example.brown.Brown_FaceBook$FBSessionDelegateImpl', referenced from method com.example.brown.Brown_FaceBook.onCreate
02-20 22:02:29.558: WARN/dalvikvm(236): VFY: unable to resolve new-instance 95 (Lcom/example/brown/Brown_FaceBook$FBSessionDelegateImpl;) in Lcom/example/brown/Brown_FaceBook;
02-20 22:02:29.558: DEBUG/dalvikvm(236): VFY: replacing opcode 0x22 at 0x007e
02-20 22:02:29.570: DEBUG/AndroidRuntime(236): Shutting down VM
02-20 22:02:29.577: WARN/dalvikvm(236): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
02-20 22:02:29.587: ERROR/AndroidRuntime(236): Uncaught handler: thread main exiting due to uncaught exception
02-20 22:02:29.597: ERROR/AndroidRuntime(236): java.lang.NoClassDefFoundError: com.example.brown.Brown_FaceBook$FBSessionDelegateImpl
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at com.example.brown.Brown_FaceBook.onCreate(Brown_FaceBook.java:80)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at android.os.Handler.dispatchMessage(Handler.java:99)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at android.os.Looper.loop(Looper.java:123)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at android.app.ActivityThread.main(ActivityThread.java:4363)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at java.lang.reflect.Method.invokeNative(Native Method)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at java.lang.reflect.Method.invoke(Method.java:521)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
02-20 22:02:29.597: ERROR/AndroidRuntime(236): at dalvik.system.NativeStart.main(Native Method)
感谢。
推荐答案
我在哪里见过的Eclipse似乎忘了,包括从其他项目中的类,你的Android应用内依赖于之前类似的错误。不知它可以在一个状态获取在那里可以看到的类编译和检查存在与清单等,但不将它们打包没有问题。有时它是通过消除依赖,并把它背可以解决的。
I've seen similar errors before where Eclipse seems to forget to include the classes from another project that you depend on inside your Android app. Somehow it can get in a state where it can see the classes for compiling and checking there are no problems with the manifest, etc. and yet not package them. Sometimes it is fixable by removing the dependency and putting it back.
这是从该网站下载的,你应该有两个项目。 Android的项目被称为fbconnect样本。 Java项目被称为fbconnect-机器人。首先要确保你有两个项目,而且都没有被显示在Eclipse Problems视图中的任意构建问题。项目菜单,然后自动构建应该进行检查。 Package Explorer中应列出fbconnect,机器人和fbconnect样本。窗口菜单 - >显示视图 - >问题不应有构建问题。
From the download from that site you should have two projects. The Android project is called fbconnect-sample. The Java project is called fbconnect-android. First make sure you have both projects and that neither is showing any build problems in the Eclipse Problems view. Project menu, then Build Automatically should be checked. Package Explorer should list "fbconnect-android" and "fbconnect-sample". Window menu -> Show View -> Problems should show no build problems.
如果你没有这两个项目,他们通过转到文件菜单中创建,然后导入...,然后导入现有的项目到工作区,然后选择从fbconnect-android.zip下载提取fbconn目录。这两个项目应该根据项目显示:在对话框中的标题,然后点击完成。该fbconnect-Android项目的需要,以建立一个没有问题的ANDROID_JAR CLASSPATH变量设置为从SDK中的android.jar。
If you don't have both projects, they are created by going to the File menu, then Import..., then Import Existing Projects into Workspace, then choosing the fbconn directory extracted from the fbconnect-android.zip download. Both projects should show under the Projects: heading in the dialog, then hit Finish. The fbconnect-android project needs an ANDROID_JAR classpath variable set to the android.jar from the SDK in order to build without problems.
现在,要尽量去除的依赖,并把它背的解决方法,右键点击Project Explorer中的fbconnect样本项目,选择属性,那么Java构建路径,然后项目,然后fbconnect-机器人,然后取出,然后好。现在,右键点击fbconnect样本再次,那么Java构建路径,然后项目,然后添加,然后fbconnect,机器人,然后确定,然后确定。有时后做了Eclipse开始从你的APK再根据项目包装类。就我而言,此下载,样品跑到我的Droid手机上没有罚款的。刚刚导入现有项目和以去除全部的构建问题设置CLASSPATH变量已经足够了。
Now, to try the removing the dependency and putting it back workaround, right click on the fbconnect-sample project in the Project Explorer, choose Properties, then Java Build Path, then Projects, then fbconnect-android, then Remove, then OK. Now right click on fbconnect-sample again, then Java Build Path, then Projects, then Add, then fbconnect-android, then OK, then OK. Sometimes after doing that Eclipse starts packaging the classes from the project you are depending on in the APK again. In my case, for this download, the sample ran fine on my Droid phone without that. Just importing the existing projects and setting the classpath variable in order to remove all the build problems was enough.
这篇关于找不到Android上app.how类异常的Facebook?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!