Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not resolve all dependencies for configuration ':app:_debugCompile'-Facebook

I have been trying to integrate facebook sharing into my app. But i keep getting the following error :

Error:A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugCompile'. Could not find any version that matches com.android.support:support-v4:[22,23). Searched in the following locations: //jcenter.bintray.com/com/android/support/support-v4/maven-metadata.xml //jcenter.bintray.com/com/android/support/support-v4/ //repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml //repo1.maven.org/maven2/com/android/support/support-v4/ file:/Users/geraldgoh/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/maven-metadata.xml file:/Users/geraldgoh/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/maven-metadata.xml file:/Users/geraldgoh/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/ Required by: Facebook:app:unspecified > com.facebook.android:facebook-android-sdk:4.6.0

build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.example.dothis.facebook"
    minSdkVersion 16
    targetSdkVersion 21
    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:21.0.3'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
}

Android manifest file

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dothis.facebook" >

<uses-permission android:name="android.permission.INTERNET" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/facebook_app_id" />


    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER"    />
        </intent-filter>
    </activity>
</application>

</manifest>

Can someone help me on how to solve this error. Thank you.

like image 501
marian Avatar asked Nov 09 '22 04:11

marian


1 Answers

It's because you have written the wrong dependency information for compiling.

It's SDK not SADK.

compile 'com.facebook.android:facebook-android-sdk:4.0.0

like image 132
Animesh Jena Avatar answered Nov 14 '22 22:11

Animesh Jena