'ANDROID_BUILD_SDK_VERSION' Error using the SDK for Facebook

I constantly get the same error in HelloFacebookSample when importing the Facebook SDK.

Error: (8, 0) Could not find property 'ANDROID_BUILD_SDK_VERSION' on project ': HelloFacebookSample'.

I know the error relates to HelloFacebookSample, and I tried to assign 'ANDROID_BUILD_SDK_VERSION' = 20 (MY SDK VERSION). He still removes the same error.

Here is a snapshot

enter image description here

This mistake sucks life out of me. How can I get rid of this error?

+4
source share
3 answers

, 'ANDROID_BUILD_SDK_VERSION ' 20 HelloFacebookSample/build.gradle, Facebook/build.gradle.

+1

"build.gradle" Facebook , gradle.properties ", ​​ ANDROID_BUILD_SDK_VERSION. , , , " gradle.properties" .

ANDROID_BUILD_TARGET_SDK_VERSION=19 ANDROID_BUILD_TOOLS_VERSION=10.0.0 ANDROID_BUILD_SDK_VERSION=19 ANDROID_BUILD_MIN_SDK_VERSION=11

+6

, , . , , .

Android Studios 1.1 Facebook SDK 4.0.

  • , Android Studios, \facebook-android-sdk-4.0.1\facebook\build.gradle javadoc (: Javadoc):

    source = android.sourceSets.main.java.srcDirs
    classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
    

:

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath += files(ext.androidJar)
}

getBootClasspath() , setTargetInfo() , : Mansukh Ahir

  1. SDK :\facebook-android-sdk-4.0.1 gradle.properties SDK, :
ANDROID_BUILD_MIN_SDK_VERSION=15
ANDROID_BUILD_TARGET_SDK_VERSION=21
ANDROID_BUILD_TOOLS_VERSION=21.1.2
ANDROID_BUILD_SDK_VERSION=21
  1. Android Studios Android Studios\facebook-android-sdk-4.0.1\samples

Android Studios should now import everything. You will still experience some errors during import, as some samples, such as MessengerSendSample, have build.gradle files that point to the minimum version of the SDK 14 instead of 15, as defined in the gradle.properties file. Just open MessengerSendSample build.gradle and change the value to 15 and it should work.

+1
source

Source: https://habr.com/ru/post/1568718/


All Articles