4
votes

I have imported the Facebook SDK downloading it there : https://github.com/facebook/facebook-android-sdk/commits/master and following the instructions there http://www.android10.org/index.php/articleslibraries/290-facebook-integration-in-your-android-application

I have added FacebookSDK as a Library for my current project.

But I have errors in all the Samples imported when I import the facebook project: "Project FacebookSDK is missing required library libs/android-support-v4.jar" appears as one error for FacebookSDK project And then I have "The container 'Android Dependencies' references non existing library C:...\facebook-android-sdk-master\facebook\bin\facebooksdk.jar" for all the facebook sample projects that are in the facebook project.

I tried to clear the project, to do Properties > Java Compiler > Compiler compliance level 1.6 (because 5.0 or 6.0 level was needed, not 1.7, so I downloaded jdk 1.6) tried to do Android Tools > Fix project properties

But I still have the same erros... Could someone tell me what I should do? Thanks

2
Try this: Do you have lib folder then Right click on it.. go to Build Path--->Add to build path.Virag Brahme
When I right click on libs, Build Path > Configure Build Paths then Librairies I have a folder "Android Dependencies" and I have the file facebooksdk.jar it is written "missing" .. I don't know what to add to build path? How would you do that?morg
@Morg Select "Missing one" and click Remove button and click "Add External Jars" button and Add from your Local directory and click OK.Avadhani Y

2 Answers

18
votes

I think you have to configure Buildpath of your project. Do this as suggested below:

RightClick on your Project -> Build Path -> Configure Buildpath

Then the window be will be shown with Libraries as one of the tab. Select that tab.

Then click Add External Jars in the right side buttons list. Add the required Jars and select OK. Once clean and build your project.

Hope this will help you.

3
votes

I had the same problem and as I imported FacebookSDK project and all sample projects with it as described in this getting started https://developers.facebook.com/docs/android/getting-started . Due to this none of the projects compiled as samples depends on facebooksdk.jar and FacebookSDK project doesn't build because of error sin other projects. Do this:

  1. Close all the sample projects
  2. Just clean and built FacebookSDK project
  3. You should see facebooksdk.jar in bin folder
  4. Open all the other projects, clean and build

All error of missing library should go away