title: Android Importing Facebook SDK
body: <p>I've been trying to add a facebook login/share option in my app for almost 3-4 days and I'm completely unable to do so, I keep getting errors in every step I make.</p>
  
  <p>I have been following alot of tutorials, and here's one of them:
  <a href="https://developers.facebook.com/quickstarts/1855739941322466/?platform=android" rel="nofollow noreferrer">https://developers.facebook.com/quickstarts/1855739941322466/?platform=android</a></p>
  
  <p>I almost finished all the steps, but I see that I have an issue in the first step, can't import the SDK.</p>
  
  <p>Here's my build.grade(Project: Facebookapp)</p>
  
  <pre><code>buildscript {
  repositories {
      jcenter()
      mavenCentral()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:1.5.0'
  
        }
  }
  
  allprojects {
  repositories {
      jcenter()
        }
   }
  
   task clean(type: Delete) {
  delete rootProject.buildDir
  }
  </code></pre>
  
  <p>Just added the "mavenCentral()" and removed the comment lines.</p>
  
  <p>And here's the build.grade(Module: App)</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
  compileSdkVersion 19
  buildToolsVersion "19.1.0"
  
  defaultConfig {
      applicationId "com.example.hesham.facebookapp"
      minSdkVersion 19
      targetSdkVersion 19
      versionCode 1
      versionName "1.0"
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  }
  
  dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  testCompile 'junit:junit:4.12'
  compile 'com.android.support:appcompat-v7:19.1.0'
  compile 'com.android.support:support-v4:19.1.0'
  compile 'com.facebook.android:facebook-android-sdk:[4,5)'
  }
  </code></pre>
  
  <p>But basically, the last compile line:</p>
  
  <blockquote>
    <p>compile 'com.facebook.android:facebook-android-sdk:[4,5)'</p>
  </blockquote>
  
  <p>causes an error in the R, which I can't solve. This is a new project by the way, because the old project was a huge mess, so I'm not sure if I forgot to add something, but I believe the compile line is what was causing all the problems.
  Hope if someone can help, thank you.</p>
  
  <p>Edit; I've also tried </p>
  
  <blockquote>
    <p>compile 'com.facebook.android:facebook-android-sdk:4.18.0'</p>
  </blockquote>
  
  <p>as the one I have in my android project, and still an error in the R.</p>