6

J'ai cette erreur:SDK Facebook conflit de dépendance

enter image description here

En ouvrant l'arbre de dépendance, je trouve qu'il n'y a rien de mal à dessinables vectoriels animés, mais le dernier sdk facebook a version précédente de support personnalisé-v4 languette. J'ai essayé d'exclure avec la commande d'exclusion de groupe mais cela ne fonctionne pas. Voici mon arbre de dépendance:

+--- com.facebook.android:facebook-android-sdk:[email protected] 
| +--- com.android.support:support-v4:[email protected] 
| | +--- com.android.support:support-compat:[email protected] 
| | | \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-media-compat:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-core-utils:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-core-ui:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | \--- com.android.support:support-fragment:[email protected] 
| |   +--- com.android.support:support-compat:[email protected] 
| |   | \--- com.android.support:support-annotations:[email protected] 
| |   +--- com.android.support:support-core-ui:[email protected] 
| |   | +--- com.android.support:support-annotations:[email protected] 
| |   | \--- com.android.support:support-compat:[email protected] 
| |   |   \--- com.android.support:support-annotations:[email protected] 
| |   \--- com.android.support:support-core-utils:[email protected] 
| |    +--- com.android.support:support-annotations:[email protected] 
| |    \--- com.android.support:support-compat:[email protected] 
| |     \--- com.android.support:support-annotations:[email protected] 
| +--- com.android.support:appcompat-v7:[email protected] 
| | +--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-v4:[email protected] 
| | | +--- com.android.support:support-compat:[email protected] 
| | | | \--- com.android.support:support-annotations:[email protected] 
| | | +--- com.android.support:support-media-compat:[email protected] 
| | | | +--- com.android.support:support-annotations:[email protected] 
| | | | \--- com.android.support:support-compat:[email protected] 
| | | |   \--- com.android.support:support-annotations:[email protected] 
| | | +--- com.android.support:support-core-utils:[email protected] 
| | | | +--- com.android.support:support-annotations:[email protected] 
| | | | \--- com.android.support:support-compat:[email protected] 
| | | |   \--- com.android.support:support-annotations:[email protected] 
| | | +--- com.android.support:support-core-ui:[email protected] 
| | | | +--- com.android.support:support-annotations:[email protected] 
| | | | \--- com.android.support:support-compat:[email protected] 
| | | |   \--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-fragment:[email protected] 
| | |   +--- com.android.support:support-compat:[email protected] 
| | |   | \--- com.android.support:support-annotations:[email protected] 
| | |   +--- com.android.support:support-core-ui:[email protected] 
| | |   | +--- com.android.support:support-annotations:[email protected] 
| | |   | \--- com.android.support:support-compat:[email protected] 
| | |   |   \--- com.android.support:support-annotations:[email protected] 
| | |   \--- com.android.support:support-core-utils:[email protected] 
| | |    +--- com.android.support:support-annotations:[email protected] 
| | |    \--- com.android.support:support-compat:[email protected] 
| | |     \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-vector-drawable:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | \--- com.android.support:animated-vector-drawable:[email protected] 
| |   +--- com.android.support:support-vector-drawable:[email protected] 
| |   | +--- com.android.support:support-annotations:[email protected] 
| |   | \--- com.android.support:support-compat:[email protected] 
| |   |   \--- com.android.support:support-annotations:[email protected] 
| |   \--- com.android.support:support-core-ui:[email protected] 
| |    +--- com.android.support:support-annotations:[email protected] 
| |    \--- com.android.support:support-compat:[email protected] 
| |     \--- com.android.support:support-annotations:[email protected] 
| +--- com.android.support:cardview-v7:[email protected] 
| | \--- com.android.support:support-annotations:[email protected] 
| +--- com.android.support:customtabs:[email protected] 
| | +--- com.android.support:support-compat:[email protected] 
| | | \--- com.android.support:support-annotations:[email protected] 
| | \--- com.android.support:support-annotations:[email protected] 
| +--- com.parse.bolts:bolts-android:[email protected] 
| | +--- com.parse.bolts:bolts-tasks:[email protected] 
| | \--- com.parse.bolts:bolts-applinks:[email protected] 
| |   \--- com.parse.bolts:bolts-tasks:[email protected] 
| \--- com.google.zxing:core:[email protected] 

Je veux utiliser la dernière bibliothèque appcompat que je veux soutenir Oreo. Quelqu'un peut-il me guider à ce sujet? En outre, n'est pas la faute de ce facebook pour utiliser une dépendance plus ancienne pour les onglets personnalisés? Merci beaucoup pour votre temps et votre aide dans ce dossier.

Répondre

14

Facebook SDK for Android utilise la version de la bibliothèque de support 25.3.1, vous devez donc l'exclure d'utiliser la plus récente bibliothèque de soutien. Vous pouvez essayer d'utiliser les éléments suivants:

// 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' 
} 
+0

Merci beaucoup !! Ça a marché. Mais l'arbre de dépendance a montré que seuls les customtabs étaient 25.3.1. Aussi, pourquoi facebook dort? Une idée? –

+0

à mon humble avis, le code ci-dessus est juste un moyen simple pour s'assurer que la bibliothèque de soutien en conflit n'est pas inclus pour la version sdk facebook 4.26.0. Vous pouvez essayer d'exclure uniquement les customtabs. Je suis désolé, je ne comprends vraiment pas la signification de "pourquoi dors-je facebook?" Pourriez-vous élaborer plus? –

+0

J'ai essayé pour customtabs cela n'a pas fonctionné. En ce qui concerne facebook dormir, était juste une blague. Je veux dire pourquoi n'ont-ils pas mis à jour les dépendances dans leur SDK. –

10

Pour facebook-android-sdk: 4.28.0 la liste est un peu plus;)

implementation 'com.android.support:support-v4:26.1.0' 
implementation 'com.android.support:cardview-v7:26.1.0' 
implementation 'com.android.support:customtabs:26.1.0' 
implementation 'com.android.support:support-annotations:26.1.0' 
implementation 'com.android.support:support-core-utils:26.1.0' 
implementation('com.facebook.android:facebook-android-sdk:4.28.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' 
    exclude group: 'com.android.support', module: 'support-annotations' 
    exclude group: 'com.android.support', module: 'support-core-utils' 
} 
+0

Toute solution pour 4.29.0? Il vient avec 27.0.1 mais le dernier support est 27.0.2, donc si j'exclus com.android.support de Facebook sdk comme dans 4.28.0 il renvoie quelques erreurs de combile :(-> ... /. Gradle/caches/transforme -1/files-1.1/facebook-common-4.29.0.aar/be3a9d27cd44a8128aadc980156f8f12/res/layout/com_facebook_device_auth_dialog_fragment.xml J'ai essayé de supprimer les caches de gadle mais je n'ai pas aidé – Pelanes

+0

Je viens de mettre à jour fb sdk à 4.30.0 en utilisant supporte la librairie 27.0.2 et fonctionne parfaitement, il suffit de supprimer toutes les lignes d'exclusion et de mise en oeuvre, donc vous pouvez faire la même chose si vous ne l'utilisez pas encore. –