Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difficulty in importing the facebook-android-sdk into eclipse

I try to follow the facebook-android tutorial from here: https://developers.facebook.com/docs/mobile/android/build/#sample I am working in windows 7. I have installed the Git and cloned the GitHub repository running this command in the git Bash -> git clone git://github.com/facebook/facebook-android-sdk.git

Everything seemed fine and I got the folder “facebook-android-sdk” in my “Users” folder.

But when I try to import the project in eclipse workspace so to use it as a library I cannot make it work. I’ve tried 3 things:

  1. Create the project from existing source (as the tutorial says), when I browse to the “facebook-android-sdk” folder and create the project, I get this message in my cosole: [2011-12-04 14:01:49 - com_facebook_android] AndroidManifest.xml file missing! Also in the package explorer, the src folder seems to be empty.

  2. If I try to import the project when I browse the folder I get a message “No projects are found to import”

  3. I also tried to make a test project where I copied all the classes of the android facebook sdk so that I can use them. It worked up to a degree, but it does not seem a proper thing to do.

So what do I do wrong? Is there something else I should do using the git repository (I am completely new to git)? Or is there something wrong that I do when I try to import the project? I’ve searched the problem here and in other forums but didn’t find a satisfying answer (or maybe I did not understand it). Please help!

EDIT: I've tried one 4th thing

4: I extracted the jar out of the project I created in 1 (even if it had an error). It is working in terms that I can compile the code of the facebook-android tutorial step 6.2 - https://developers.facebook.com/docs/mobile/android/build/#sample. So far it seems that everything goes ok. But I do not know if this is right or I should have problems in the future..

like image 313
george Avatar asked Dec 04 '11 12:12

george


People also ask

What is the latest Facebook SDK version?

The current version of the Facebook SDK for Android is version 14.1. 1 and requires the Android API 15. Code and samples for the Facebook SDK for Android are available on GitHub. When you use the Facebook SDK for Android, follow the Facebook Open Source Terms of Use and Privacy Policy.

What is Facebook integration in Android?

Android allows your application to connect to facebook and share data or any kind of updates on facebook.


1 Answers

I had the same problem. But now I think I solved it, even if the solution is not satisfying.

Create the project from existing source as the facebook tutorial says. Then make a right click on the project and choose "Import", choose "General" -> "File System" and go to "Next". Now click on "Browse..." and choose the folder .../facebook-android-sdk/facebook. Repeat these steps with the src and the res folder (right click on these folders for "Import", choosing the src and res folder in .../facebook-android-sdk/facebook).

Now it works. I don't know why Eclipse doesn't import all these things automatically, in the past it worked fine...

like image 112
Julia Hexen Avatar answered Oct 13 '22 12:10

Julia Hexen