14

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..

george
  • 1,386
  • 5
  • 22
  • 38
  • For me this problem started after I updated the Android stuff through Eclipse, I think Google broke something – mbwasi Dec 19 '11 at 02:08

5 Answers5

20

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...

Julia Hexen
  • 695
  • 3
  • 10
  • Thank you very much! I used to work it with a jar, but this is better. It is really strange that eclipse works this way – george Feb 17 '12 at 10:53
1

Make sure when you select the “facebook-android-sdk” folder you add /facebook at the end. So type into existing source C:/Users/facebook-android-sdk/facebook and it should work.

Hunter Gemmer
  • 96
  • 1
  • 1
  • 5
  • sorry for the late response.. I was using it with the jar and for some strange reason I didn't see your comment in my inbox. That's exactly what I import (or use to create project from existing source). But I still get "AndroidManifest.xml file missing!" error though the original folder contains an AndroidManifest.xml file.. – george Dec 14 '11 at 13:00
1

Make sure that your code's directory is dropped directly in Eclipse's root Workspace directory. There seems to be a bug in the latest version that only allows this kind of import/load when all code is directly in a directory in your Workspace. Otherwise it copies just a couple folders/files from where you put it, and not the rest, and gets quite confused.

Fitch
  • 11
  • 2
  • 1
    i filed a bug (http://code.google.com/p/android/issues/detail?id=26369) and found a work around - work around is to add the project into Eclipse's root workspace directory (as you mention), and then right click, refactor, move (and move it where you want). – ahmedre Mar 04 '12 at 01:09
1

I downloaded the file in zip format from the git directory. I created a android project, then i imported the zip archive (import ->archive file). It worked for me.

Arizanov
  • 11
  • 2
0

If you want to import projects into Eclipse, you do not have to go down to the src folder, just do

File > Import > Existing projects into Workspace

then go to the directory where the folder is, say your Documents folder C:\users\Documents then just click 'ok' The window then displays all the folders in the Documents folder. you can then select the project you want to import and click finish.

Ojonugwa Jude Ochalifu
  • 26,627
  • 26
  • 120
  • 132