2

My goal: create a page that logs in via facebook

What I've done so far: followed the instructions at https://developers.facebook.com/docs/facebook-login/android

The problem that I need help with: when I add

compile 'com.facebook.android:facebook-android-sdk:[4,5)'

to the dependencies in app | Gradle Scripts | build.gradle (Module: app)

it fails to build and presents the error message

Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(25.3.1) from [com.android.support:cardview-v7:25.3.1] AndroidManifest.xml:24:9-31 is also present at [com.android.support:appcompat-v7:26.0.0-alpha1] AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1). Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml:22:5-24:34 to override.

The two other compiles in the dependencies by default are:

compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'

Hovering over the top statement presents the message:

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 26.0.0-alpha1, 25.3.1. Examples include com.android.support:animated-vector-drawable:26.0.0-alpha1 and com.android.support:cardview-v7:25.3.

Android studio version is 2.3.3 and facebook SDK is 4.24.0
Does anyone know why these errors are occurring and/or how to fix them? Thanks

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Hiro
  • 43
  • 5
  • I have same issue. if change `26.+` to `25.3.1` occur this error `Error:Failed to resolve: com.android.support:support-core-ui:25.4.0` – Hun Jul 08 '17 at 08:29

4 Answers4

1

add compile 'com.android.support:cardview-v7:26.0.0-alpha1' if you don't use it.

Hun
  • 3,652
  • 35
  • 72
1

I was able to solve it by adding

compile 'com.android.support:cardview-v7:26.0.0'
compile 'com.android.support:animated-vector-drawable:26.0.0'
compile 'com.android.support:customtabs:26.0.0'
0

For me it worked by adding CustomTabs dependency :

compile 'com.android.support:customtabs:26.+'

0

This should solve your problem: https://stackoverflow.com/a/46212995/5273427

For your convinience here's the code (credits to ישו אוהב אותך):

// Facebook SDK Dependencies, need to be excluded.
// compile 'com.android.support:support-v4:25.3.1'
// compile 'com.android.support:appcompat-v7:25.3.1'
// compile 'com.android.support:cardview-v7:25.3.1'
// compile 'com.android.support:customtabs:25.3.1'

compile ('com.facebook.android:facebook-android-sdk:4.26.0') {
     exclude group: 'com.android.support', module: 'support-v4'
     exclude group: 'com.android.support', module: 'appcompat-v7'
     exclude group: 'com.android.support', module: 'cardview-v7'
     exclude group: 'com.android.support', module: 'customtabs'
}
Variag
  • 1,056
  • 10
  • 25