Android facebook SDK doing error java.lang.NoClassDefFoundError‎

Fabien picture Fabien · Aug 25, 2010 · Viewed 21k times · Source

I have just downloaded the facebook SDK from http://github.com/facebook/facebook-android-sdk I unpack it from git and opened Eclipse. I then created a new project using existing source and selected the facebook directory. So the sdk project came up correctly (i think). Then I created a new project again using existing source and selected the "Simple" example. Its came up with errors. I went in the properties and selected Build Path section and added the facebook SDK project and applyed. All the errors disappear. I then tried to run the Example but im getting an exception on the first call to facebook SDK function ! Exception is NoClassDefFoundError. Its seems that at runtime it cannot find the class of the SDK. How come ? Any suggestions ? Someone did sucessfully run this example ? Any help would be greatly appreciated.

Answer

Dumitru Hristov picture Dumitru Hristov · May 6, 2011

Right click on the Project. Choose Properties -> Android. Under Library click on the Add... button and select the path to the Facebook SDK Project.