views:

611

answers:

2

hi all,

i am doing facebook app in my project.

i followed this step the sample app in this link.

http://code.google.com/p/fbconnect-android/downloads/list

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)

thanks.

A: 

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.

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.

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.

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.

Lance Nanek
hey please elaborate this statement in ur answer.."The fbconnect-android project needs an ANDROID_JAR classpath variable set to the android.jar from the SDK in order to build without problems."
Praveen Chandrasekaran
i got this for fbconn-android. Unbound classpath variable: 'ANDROID_JAR' in project 'fbconnect-android' fbconnect-android Build path Build Path Problem.how to????
Praveen Chandrasekaran
fbconnect-android is a Java project, not an Android project. It does refer to Android classes, however. Therefore, in order to compile, it needs the Android classes in the classpath. This is done by the classpath variable ANDROID_JAR detailed on their setup page: http://code.google.com/p/fbconnect-android/wiki/Setup . Basically you just need to setup that variable in the Java Build Path dialog in Eclipse to point to android.jar from the sdk platforms directory.
Lance Nanek
A: 

yeah,that is weried.

Jhon