I am trying to use Facebook login API, but when I write the "implementation" in gradle file, I get an error:
Error:(252, 5) error: duplicate value for resource 'attr/font' with config ''.
Error:(252, 5) error: resource previously defined here.
When I click on "Jump to source", Android Studio brings me in a file "values.xml", a non-writable file, that looks like this:
// More stuff above, the following line is where the error brings me
<dimen name="abc_action_bar_content_inset_material">16dp</dimen>
<dimen name="abc_action_bar_content_inset_with_nav">72dp</dimen>
<dimen name="abc_action_bar_default_height_material">56dp</dimen>
<dimen name="abc_action_bar_default_padding_end_material">0dp</dimen>
<dimen name="abc_action_bar_default_padding_start_material">0dp</dimen>
// More stuff
Here is my 'app' build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.discodery.android.discoderyapp"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
buildTypes.each {
it.buildConfigField 'Integer', 'RESTAURANT_ID', '2'
}
}
/*
productFlavors {
dev {
}
prod {
}
}*/
dataBinding {
enabled = true
}
}
kapt {
generateStubs = true
}
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 "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.mikhaellopez:circularimageview:3.0.2'
compile 'de.hdodenhof:circleimageview:2.2.0'
//Permissions
compile 'com.beust:klaxon:2.0.11'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
compile 'com.hwangjr.rxbus:rxbus:1.0.5'
compile 'org.parceler:parceler-api:1.1.6'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.okhttp3:okhttp:3.4.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.google.dagger:dagger:2.7'
compile 'com.facebook.fresco:fresco:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile 'com.karumi:dexter:2.3.1'
testCompile 'junit:junit:4.12'
kapt 'com.android.databinding:compiler:2.3.0'
kapt 'org.parceler:parceler:1.1.6'
kapt 'com.google.dagger:dagger-compiler:2.7'
compile 'com.google.android.gms:play-services-vision:11.6.0'
// Facebook SDK Core only (Analytics)
implementation 'com.facebook.android:facebook-core:4.+'
// Facebook Login only
implementation 'com.facebook.android:facebook-login:4.+'
// Facebook Share only
implementation 'com.facebook.android:facebook-share:4.+'
// Facebook Places only
implementation 'com.facebook.android:facebook-places:4.+'
// Facbeook Messenger only
implementation 'com.facebook.android:facebook-messenger:4.+'
// Facebook App Links only
implementation 'com.facebook.android:facebook-applinks:4.+'
// Facebook Android SDK (everything)
implementation 'com.facebook.android:facebook-android-sdk:4.+'
// Audience Network SDK. Only versions 4.6.0 and above are available
implementation 'com.facebook.android:audience-network-sdk:4.+'
// Account Kit
implementation 'com.facebook.android:account-kit-sdk:4.+'
}
repositories {
jcenter()
mavenCentral()
}
apply plugin: 'kotlin-android-extensions'
Does someone have an idea about which "implementation" or "compile" line it could be from? Without the Facebook SDK implementation lines, the project does compile and works properly.
As the logs tell me "duplicate value", I think that Facebook SKDs create some values like strings, that have exactly the same id or name that an other SDK.
Does anyone have a solution for this?
EDIT
The question concern the compatibility errors with Facebook SDK. Is there a way to see if a dependency is or is not compatible with another one?