I am trying to use facebook SDK in my android apps, and I am starting to add maven central repository to my build.gardle
. Although, I've found 2 build.gardle
which belong to project and app. Here they are;
- Android Studio: 1.5.1
- Gradle Version: 2.8
- Android Plugin Version: 1.5.0
Build.gardle (Project)
buildscript {
repositories {
jcenter()
mavencentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
}
}
allprojects {
repositories {
jcenter()
mavencentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gardle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 15
targetSdkVersion 23
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:23.2.0'
compile 'com.android.support:design:23.2.0'
}
Yet I get this following error during build;
Gradle DSL method not found: mavencentral()
I have tried;
- Checking both gardle files
- Removing android compile dependencies that's actually should be there
- Checking android
packagingOptions.exclude
- Checking if there's android method in the gardle
And, I haven't tried to update my gardle or android studio, but I am just wondering whether it's really needed or I am doing something wrong with my build.gardle
.
Any suggestion is appreciated. Thank you.