2
votes

I am working with Android API 17 on eclipse Indigo. I have cloned the faccebook sdk from github and done the facebook library project set up using the source project provided in the fb sdk.

Now I'm trying to include this library project in my android demo project. I have added it under Project properties->Android->Library section. Im seeing green color tick mark infront of the added library. Also, i have added the same in the Project properties->Java build path->Projects.

build is successful. but when i try to install on my AVD, im getting the error, E/AndroidRuntime(748): java.lang.NoClassDefFoundError: com.facebook.android.Facebook

Can anybody plz help me how to fix this issue.

---- EDIT ------ One more thing I have observed is, when i opened Project properties->Android window, the green tick mark is not displaying under Library section, instead I'm seeing red cross mark.

Any ideas?

Thanks, Venkat Papana

5

5 Answers

3
votes

Same thing happen for me also.. try below .. it will work..

A Best way to add External Jars to your Android Project or any Java project is:

Create a folder called libs into you project root folder Copy your Jar files to the libs folder Now right click on the Jar file and then select Build Path > Add to Build Path, this will create a folder called Refrenced Library into you project, and your are done By do doing like this, whenever you transfer you project to other Computer, you will not miss your libraries which are being referenced to some space on your Hard drive.

(The facebooksdk.jar can be found at the facebook-sdk directory: <facebook-sdk>\facebook\bin)

2
votes

i know this question is old But I thought that may be it can help someone.

Move the library project and the application on the same drive. Usually this is a bug in Eclipse.

I solved my problem by moving them in same drive on my computer. You can Give it a try.

1
votes

You need to make both project in same dictionary then include it using Project Properties -> Android-> Library. This works fine.

0
votes

You do not have to add this to the library project as this is not the library.

https://github.com/facebook/facebook-android-sdk is the help of the project ad the sample code for the including the project in our code. Just you need to create the app ID for the facebook by registering your api with it.

Hope this will help you in your project.

0
votes

Resolved by copying the com.facebook.android source code to my project source.