Reputation: 11
I'm trying to implement the Facebook implementation as mentioned in the following link -
https://developers.facebook.com/docs/mobile/android/build/
However, after I've implemented upto step 6.3 and try to run my application, I'm being shown the following error message in the log -
03-01 14:19:50.124: W/dalvikvm(329): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
03-01 14:19:50.135: E/AndroidRuntime(329): Uncaught handler: thread main exiting due to uncaught exception
03-01 14:19:50.173: E/AndroidRuntime(329): java.lang.NoClassDefFoundError: com.facebook.android.Facebook
03-01 14:19:50.173: E/AndroidRuntime(329): at com.test.fbandroid.MyGreatAppActivity.<init>(MyGreatAppActivity.java:14)
03-01 14:19:50.173: E/AndroidRuntime(329): at java.lang.Class.newInstanceImpl(Native Method)
03-01 14:19:50.173: E/AndroidRuntime(329): at java.lang.Class.newInstance(Class.java:1479)
03-01 14:19:50.173: E/AndroidRuntime(329): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
03-01 14:19:50.173: E/AndroidRuntime(329): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
03-01 14:19:50.173: E/AndroidRuntime(329): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
03-01 14:19:50.173: E/AndroidRuntime(329): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
03-01 14:19:50.173: E/AndroidRuntime(329): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
03-01 14:19:50.173: E/AndroidRuntime(329): at android.os.Handler.dispatchMessage(Handler.java:99)
03-01 14:19:50.173: E/AndroidRuntime(329): at android.os.Looper.loop(Looper.java:123)
03-01 14:19:50.173: E/AndroidRuntime(329): at android.app.ActivityThread.main(ActivityThread.java:4363)
03-01 14:19:50.173: E/AndroidRuntime(329): at java.lang.reflect.Method.invokeNative(Native Method)
03-01 14:19:50.173: E/AndroidRuntime(329): at java.lang.reflect.Method.invoke(Method.java:521)
03-01 14:19:50.173: E/AndroidRuntime(329): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
03-01 14:19:50.173: E/AndroidRuntime(329): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
03-01 14:19:50.173: E/AndroidRuntime(329): at dalvik.system.NativeStart.main(Native Method)
I'm using Android 2.1 with version 7 as the mini SDK. Any pointers on this would be of great help.
Thanks in advance, Amitava
Upvotes: 1
Views: 307
Reputation: 90
it's quite easy ....
Download the code for facebook SDK and add as a library in your project and then run it.
Add two variables as
String appId="000000000000000"; //your appp ID
Facebook facebook;
and initialise the facebook
variable
facebook = new Facebook(appId);
Upvotes: 1