2

I am using Android studio version 1.2 and i am going to use the Facebook SDK to create an application that will allow the user to post in their wall. But when i import the module or the Facebook SDK i am currently getting this error.

Error:(15, 0) Could not find property 'ANDROID_BUILD_SDK_VERSION' on project ':facebook'.

My downloaded sdk is the latest one. this is the name of the zip file when i downloaded. facebook-android-sdk-4.4.1

This is the build.gradle that i have.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc3"

    defaultConfig {
        applicationId "com.example.jerex.facebook"
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories { mavenCentral() }
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}

This is the another build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

I do not put codes yet because i am just implementing the facebook sdk but i keep on having this error. thats why i cannot start working with code

user3802633
  • 347
  • 1
  • 4
  • 16

1 Answers1

2

Just add this code in the facebook\build.gradle just find that gradle and change this code

android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION

defaultConfig {
    minSdkVersion 8
    targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
}

to this code.

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 19
    }
user3802633
  • 347
  • 1
  • 4
  • 16