Android Facebook Sdk Doing Error Java.lang.noclassdeffounderror
Solution 1:
Right click on the Project. Choose Properties -> Android. Under Library click on the Add... button and select the path to the Facebook SDK Project.
Solution 2:
I had your same problem, and there was a suggestion in another question thread to export the Android Facebook SDK as a jar file and add that file to your project.
Although some people said that the previous solution worked with them, it didn't work with me!
The only thing worked with me is: coping the Android Facebook SDK six classes into my project and that solved my problem.
Steps:
1- I simply copied the following 6 classes from the Android SDK into my project AsyncFacebookRunner.java DialogError.java Facebook.java FacebookError.java FbDialog.java Util.java
2- I've also copied the facebook_icon.png file from the drawable folders to my drawable folders.
3- I imported my R.java class in the the copied FbDialog.java class.
My advice is to try the jar solution first (as it is the neat way to be a developer), if it didn't work with you, then try my solution (as it is a way to solve the problem).
Thanks and hopefully it will solve your problem.
Mohamed.
Solution 3:
I managed to overcome this error by doing a clean build for both my project and facebook library (referenced) project.
The steps:
On Eclipse:
1) Select Project -> Clean
2) Selectboth your project and facebook sdk project
3) select OK
Solution 4:
I too faced the same problem. I was able to overcome this issue by placing the Facebook SDK library as well as my project(to which I want to link the Facebook SDK) within the same workspace. Now go to your project->right click->properties->android->scoll down->add->select the path to facebook SDK->press ok.
This way you can link the Facebook SDK to your project. Only adding the Facebook jar will result in an exception as this does not contain all the classes.
Solution 5:
I also had this exception and tried almost everything i found. But then i copied the facebook sdk project to my workspace folder and then referenced it from there in my project and it worked.
Don't know why this happened, this made no sense to me as i was providing it the path while adding reference but anyways, It solved the problem.
Post a Comment for "Android Facebook Sdk Doing Error Java.lang.noclassdeffounderror"