0

I know there are lots of questions and articles about how to integrate android facebook sdk into an existing project. I have tried some of the methods they have but with no success.

I have imported the facebook (sdk folder) into a new project and have the resulting src, res folders in a separate project. I am still not sure how to integrate that with my already existing project.

I know I cannot simply copy and paste the java files into my project because there will be errors linking resources and other .java files as the package names and destinations will change.

What is the simplest way to do this?

Thanks.

Pacemaker
  • 1,117
  • 2
  • 17
  • 36

4 Answers4

1

Import the FB SDK to your workspace. Then open the properties dialog of your project. Click the add button at the bottom of the dialog. Choose the FB SDK you have imported. Click Apply and Ok.

Sripathi
  • 1,760
  • 15
  • 20
  • I just did that but I get an exclamation mark icon on my project, and whenever I build it says the project contains errors, but I cant find the errors in the individual files. – Pacemaker May 13 '14 at 00:50
  • try to trace it by error log. To get that go to window->show view-> error log – Sripathi May 14 '14 at 05:15
1

Look that (Spanish blog, you can translate)

http://fpalero.tk/facebook-sdk-para-android/

If you dont understand say me and i translate for you and explain all steps.

But it's easy, when you import sdk facebook only delete libs/“android-support-v4.jar” on your project and changes by the libs folder of sdk facebook.

Aspicas
  • 4,498
  • 4
  • 30
  • 53
  • Hey first thanks for the effort. The link is broken. I deleted android-support-v4.jar from facebook's project. Should I delete it from my project instead? Also, the first warning i get is "unable to write jarlist cache file jarlist.cache" . – Pacemaker May 12 '14 at 14:18
  • nonono 1.-you must import sdk facebook, “Select” “Existing Projects into Workspace”, "Next" 2.-Select library “FacebookSDK”. 3.-“Properties” on your project. 4.-(left menu) select Android, push "Add" down on library and select SDK Facebook. 5.-"OK" 6.-THE ERROR!! 7.- on your project delete "libs/android-support-v4.jar” (on your proyect) 8.- Copy; FacebookSDK/libs/"android-support-v4.jar" on your folder libs in your project. 9.- restart Eclipse. – Aspicas May 12 '14 at 17:20
  • Only you delete "android-support-v4.jar" n your project and copy "android-support-v4.jar" (facebook project) on yours libs folder – Aspicas May 12 '14 at 17:25
  • I just did, and the previous errors went away. I still get errors in the project. – Pacemaker May 13 '14 at 00:51
  • what android Version u r using for compile on your project? – Aspicas May 13 '14 at 01:00
1

see the facebook developers site for complete detail and for download Facebook SDK for any platform facebook sdk download and integration sdk to project and also interaction to messenger with intent

Adiii
  • 54,482
  • 7
  • 145
  • 148
0

Right click on your project in project explorer window >> Properties >> Andoird >> In the dialog poped >> click on Add >> Select the FB library >> Click ok

Facebook sdk will be added to your project.

John
  • 8,846
  • 8
  • 50
  • 85
  • I tried this and got these errors in the console: Unable to resolve target 'android-8' [2014-05-12 13:46:37 - peeps] Found 3 versions of android-support-v4.jar in the dependency list, [2014-05-12 13:46:37 - peeps] but not all the versions are identical (check is based on SHA-1 only at this time). [2014-05-12 13:46:37 - peeps] All versions of the libraries must be the same at this time. [2014-05-12 13:46:37 - peeps] Versions found are: Jar mismatch! Fix your dependencies – Pacemaker May 12 '14 at 11:56