Reputation: 351
I'm consistenly getting the same error on HelloFacebookSample when importing Facebook SDK.
Error:(8, 0) Could not find property 'ANDROID_BUILD_SDK_VERSION' on project ':HelloFacebookSample'.
I know the error is regarding the HelloFacebookSample, and I've tried to assign 'ANDROID_BUILD_SDK_VERSION' = 20 (MY SDK VERSION). It still shoots the same error.
Here is a snapshot
This error is sucking the life out of me. How can I get rid of this error?
Upvotes: 4
Views: 11172
Reputation: 19938
Seeing that the above answers might be outdated by now, I'm posting this updated solution. I spent two hours on it and finally got it to work.
I'm using Android Studios 1.1 with Facebook SDK 4.0.
Before you open Android Studios, go to \facebook-android-sdk-4.0.1\facebook\build.gradle and replace the task javadoc(type: Javadoc):
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
with this:
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath += files(ext.androidJar)
}
Above is from Cannot call getBootClasspath() before setTargetInfo() is called courtesy of: Mansukh Ahir
ANDROID_BUILD_MIN_SDK_VERSION=15 ANDROID_BUILD_TARGET_SDK_VERSION=21 ANDROID_BUILD_TOOLS_VERSION=21.1.2 ANDROID_BUILD_SDK_VERSION=21
Android Studios should now import everything. You will still experience some errors during the import as some of the samples, such as the MessengerSendSample, have build.gradle files that point to minimum SDK version of 14 instead of 15 as defined in your gradle.properties file. Just open the MessengerSendSample build.gradle and change to 15 and it should work.
Upvotes: 1
Reputation: 69
Facebook's "build.gradle" file assumes that you have a "gradle.properties" file where the ANDROID_BUILD_SDK_VERSION variable is declared. So all you have to do is create a file called "gradle.properties" in the root level and add the following to it.
ANDROID_BUILD_TARGET_SDK_VERSION=19
ANDROID_BUILD_TOOLS_VERSION=10.0.0
ANDROID_BUILD_SDK_VERSION=19
ANDROID_BUILD_MIN_SDK_VERSION=11
Upvotes: 6
Reputation: 2123
You have this error because you did not replace 'ANDROID_BUILD_SDK_VERSION
' by 20 in HelloFacebookSample/build.gradle
, not in Facebook/build.gradle
.
Upvotes: 1