1
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.and.facebook"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    mavenCentral()
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:design:25.2.0'
    compile 'com.facebook.android:facebook-android-sdk:4.20.0'
    testCompile 'junit:junit:4.12'
}

After I put the facebook sdk into the dependencies, it gives me this compile error. enter image description here where is com.android.support.cardview-v7 25.0.0??? and how do I update this to 25.2.0?

thanks

1 Answers1

2

Add this line: compile 'com.android.support.cardview-v7:25.2.0'

shmakova
  • 6,076
  • 3
  • 28
  • 44
  • Thanks. While this is indeed the right answer, just adding this alone did not work for me. I then realized this was because facebook library used cardview internally and this was conflicting with my own import. I solved it by adding an exclude group to the facebook gradle import. `exclude group: ‘com.android.support'` – Saifur Rahman Mohsin Mar 20 '17 at 12:15