2

I've just updated Android Studio to 0.5.1 and I need to import Facebook SDK into my project.

Following Facebook's guide, I'm supposed to:

  1. Open the Project Structure dialog with Command + down arrow (on OS X)
  2. Select Modules under the left nav
  3. Click + and select Import Module

But when I click the + sign, it opens a window to create a new Module, rather than give me the options to create a new one or import a Module.

What is the proper way to import a Module?

Guilherme
  • 7,839
  • 9
  • 56
  • 99
  • Possible solution is here http://stackoverflow.com/questions/21170395/how-to-include-a-library-module-dependency-in-an-android-studio-project/21170626#21170626 – Piyush Agarwal Mar 10 '14 at 14:11
  • @pyus13 that helps to understand the file organization, but I don't think it solves the problem since there are some auto-generated files when you add a new/imported module. – Guilherme Mar 10 '14 at 14:18
  • No what mentioned in the link is enough, Studio will do rest of the things for you. Only make sure you sync project after adding all the required things mentioned in the link. – Piyush Agarwal Mar 10 '14 at 14:50
  • possible duplicate of [using facebook sdk in android studio](http://stackoverflow.com/questions/19961828/using-facebook-sdk-in-android-studio) – Scott Barta Mar 10 '14 at 16:50
  • same here, I've been stuck – ppp Mar 13 '14 at 18:14

1 Answers1

4
  1. create a folder "libs" under your root folder
  2. past the unziped facebook folder to "libs"
  3. with android studio go to libs/facebook/buid.gradle edit buildToolsVersion to "19.0.1" must be like app/buid.gradle
  4. Add this line include ':libs:facebook' to your settings.gradle
  5. in app/buid.gradle add compile project(':libs:facebook'); to dependencies like this
dependencies {
    compile 'com.android.support:appcompat-v7:+'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':libs:facebook'); }

7 on menu got to build , Make project

and that is ,try on your mainActivity import com. you will get an auto complete list with facebook

zied.hosni
  • 490
  • 1
  • 5
  • 19