How to fix noClassDefFoundError: com.facebook.android.facebook -
integrating facebook sdk android app.before integrating app working fine once working facebook app stopped unexpectedly here placing code.suggest me how fix this
public class mainactivity extends activity implements onclicklistener { button btntologin, btntopost, logout; string app_id; facebook fb; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); app_id = "308180782571605"; fb = new facebook(app_id); try { btntologin = (button) findviewbyid(r.id.button1); btntopost = (button) findviewbyid(r.id.button2); logout = (button) findviewbyid(r.id.button3); btntologin.setonclicklistener(this); btntopost.setonclicklistener(this); logout.setonclicklistener(this); } catch (exception e) { // todo auto-generated catch block e.printstacktrace(); } }
here logs
08-15 22:08:52.531: e/androidruntime(2151): fatal exception: main 08-15 22:08:52.531: e/androidruntime(2151): java.lang.noclassdeffounderror: com.facebook.android.facebook 08-15 22:08:52.531: e/androidruntime(2151): @ com.sri.z4globalsoft.mainactivity.oncreate(mainactivity.java:25) 08-15 22:08:52.531: e/androidruntime(2151): @ android.app.activity.performcreate(activity.java:4465) 08-15 22:08:52.531: e/androidruntime(2151): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1049) 08-15 22:08:52.531: e/androidruntime(2151): @ android.app.activitythread.performlaunchactivity(activitythread.java:1919) 08-15 22:08:52.531: e/androidruntime(2151): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1980) 08-15 22:08:52.531: e/androidruntime(2151): @ android.app.activitythread.access$600(activitythread.java:122) 08-15 22:08:52.531: e/androidruntime(2151): @ android.app.activitythread$h.handlemessage(activitythread.java:1146) 08-15 22:08:52.531: e/androidruntime(2151): @ android.os.handler.dispatchmessage(handler.java:99) 08-15 22:08:52.531: e/androidruntime(2151): @ android.os.looper.loop(looper.java:137) 08-15 22:08:52.531: e/androidruntime(2151): @ android.app.activitythread.main(activitythread.java:4340) 08-15 22:08:52.531: e/androidruntime(2151): @ java.lang.reflect.method.invokenative(native method) 08-15 22:08:52.531: e/androidruntime(2151): @ java.lang.reflect.method.invoke(method.java:511) 08-15 22:08:52.531: e/androidruntime(2151): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:784) 08-15 22:08:52.531: e/androidruntime(2151): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:551) 08-15 22:08:52.531: e/androidruntime(2151): @ dalvik.system.nativestart.main(native method)
go project -> properties -> java build path -> order & export , make sure facebook library ticked.
Comments
Post a Comment