Failed to resolve all dependencies for configuration: app: _debugCompile'-Facebook

I am trying to integrate facebook sharing in my application. But I keep getting the following error:

Error: There was a problem setting up the project: app. Failed to resolve all dependencies for configuration: app: _debugCompile. Could not find a compatible version for com.android.support:support-v4:[22,23). Search in the following places: //jcenter.bintray.com/com/android/support/support-v4/maven-metadata.xml //jcenter.bintray.com/com/android/support/support-v4/ // repo 1 .maven.org / maven2 / com / android / support / support-v4 / maven-metadata.xml // repo 1.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 / additional / Google / m2repository / com / Android / support / support-v4 / Required: Facebook: application: not specified> com. facebook.android:facebook-android-sdk-00-00.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 in solving this error. Thanks.

+5
source share
1 answer

This is because you wrote the wrong dependency information to compile.

He SDK is not SADK.

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

+1
source

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


All Articles