I have imported facebook android sdk4.6.0 but its giving me the following error. How to resolve this error. Please help me.
Error:A problem occurred configuring project ':app'.
Artifact 'facebook-android-sdk.jar (com.facebook.android:facebook-android- sdk:4.6.0)' not found. Searched in the following locations: https://jcenter.bintray.com/com/facebook/android/facebook-android- sdk/4.6.0/facebook-android-sdk-4.6.0.jar
To use Facebook SDK in your project, you have to add it as a build dependency and import it. Follow these steps:
When you create a new project in Android Studio, be sure that the "Minimum SDK" is API 15 (Android 4.0.3) or higher
After you create a new project , open your app, then open your "/app/build.gradle" and add:
repositories { mavenCentral() }
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
Build your project clicking on "Tools > Android > Sync project".
Your build.gradle will be something like that:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
repositories {
mavenCentral()
}
defaultConfig {
applicationId "bla.bla.bla"
minSdkVersion 17
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
encoding "UTF-8"
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
}
More info in the getting started : https://developers.facebook.com/docs/android/getting-started
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.