Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
200 views
in Technique[技术] by (71.8m points)

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...