Facebook SDK dependency conflict

穿精又带淫゛_ 提交于 2019-11-27 15:55:53

问题


I am having this error:

On getting dependency tree, I found that there is nothing wrong with animated vector drawables but facebook's latest sdk has previous version of support-v4 custom tab. I tried excluding with exclude group command but its not working. Here is my dependency tree:

 +--- com.facebook.android:facebook-android-sdk:4.26.0@aar
|    +--- com.android.support:support-v4:26.0.1@aar
|    |    +--- com.android.support:support-compat:26.0.1@aar
|    |    |    \--- com.android.support:support-annotations:26.0.1@jar
|    |    +--- com.android.support:support-media-compat:26.0.1@aar
|    |    |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    |    \--- com.android.support:support-compat:26.0.1@aar
|    |    |         \--- com.android.support:support-annotations:26.0.1@jar
|    |    +--- com.android.support:support-core-utils:26.0.1@aar
|    |    |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    |    \--- com.android.support:support-compat:26.0.1@aar
|    |    |         \--- com.android.support:support-annotations:26.0.1@jar
|    |    +--- com.android.support:support-core-ui:26.0.1@aar
|    |    |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    |    \--- com.android.support:support-compat:26.0.1@aar
|    |    |         \--- com.android.support:support-annotations:26.0.1@jar
|    |    \--- com.android.support:support-fragment:26.0.1@aar
|    |         +--- com.android.support:support-compat:26.0.1@aar
|    |         |    \--- com.android.support:support-annotations:26.0.1@jar
|    |         +--- com.android.support:support-core-ui:26.0.1@aar
|    |         |    +--- com.android.support:support-annotations:26.0.1@jar
|    |         |    \--- com.android.support:support-compat:26.0.1@aar
|    |         |         \--- com.android.support:support-annotations:26.0.1@jar
|    |         \--- com.android.support:support-core-utils:26.0.1@aar
|    |              +--- com.android.support:support-annotations:26.0.1@jar
|    |              \--- com.android.support:support-compat:26.0.1@aar
|    |                   \--- com.android.support:support-annotations:26.0.1@jar
|    +--- com.android.support:appcompat-v7:26.0.1@aar
|    |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    +--- com.android.support:support-v4:26.0.1@aar
|    |    |    +--- com.android.support:support-compat:26.0.1@aar
|    |    |    |    \--- com.android.support:support-annotations:26.0.1@jar
|    |    |    +--- com.android.support:support-media-compat:26.0.1@aar
|    |    |    |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    |    |    \--- com.android.support:support-compat:26.0.1@aar
|    |    |    |         \--- com.android.support:support-annotations:26.0.1@jar
|    |    |    +--- com.android.support:support-core-utils:26.0.1@aar
|    |    |    |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    |    |    \--- com.android.support:support-compat:26.0.1@aar
|    |    |    |         \--- com.android.support:support-annotations:26.0.1@jar
|    |    |    +--- com.android.support:support-core-ui:26.0.1@aar
|    |    |    |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    |    |    \--- com.android.support:support-compat:26.0.1@aar
|    |    |    |         \--- com.android.support:support-annotations:26.0.1@jar
|    |    |    \--- com.android.support:support-fragment:26.0.1@aar
|    |    |         +--- com.android.support:support-compat:26.0.1@aar
|    |    |         |    \--- com.android.support:support-annotations:26.0.1@jar
|    |    |         +--- com.android.support:support-core-ui:26.0.1@aar
|    |    |         |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    |         |    \--- com.android.support:support-compat:26.0.1@aar
|    |    |         |         \--- com.android.support:support-annotations:26.0.1@jar
|    |    |         \--- com.android.support:support-core-utils:26.0.1@aar
|    |    |              +--- com.android.support:support-annotations:26.0.1@jar
|    |    |              \--- com.android.support:support-compat:26.0.1@aar
|    |    |                   \--- com.android.support:support-annotations:26.0.1@jar
|    |    +--- com.android.support:support-vector-drawable:26.0.1@aar
|    |    |    +--- com.android.support:support-annotations:26.0.1@jar
|    |    |    \--- com.android.support:support-compat:26.0.1@aar
|    |    |         \--- com.android.support:support-annotations:26.0.1@jar
|    |    \--- com.android.support:animated-vector-drawable:26.0.1@aar
|    |         +--- com.android.support:support-vector-drawable:26.0.1@aar
|    |         |    +--- com.android.support:support-annotations:26.0.1@jar
|    |         |    \--- com.android.support:support-compat:26.0.1@aar
|    |         |         \--- com.android.support:support-annotations:26.0.1@jar
|    |         \--- com.android.support:support-core-ui:26.0.1@aar
|    |              +--- com.android.support:support-annotations:26.0.1@jar
|    |              \--- com.android.support:support-compat:26.0.1@aar
|    |                   \--- com.android.support:support-annotations:26.0.1@jar
|    +--- com.android.support:cardview-v7:26.0.1@aar
|    |    \--- com.android.support:support-annotations:26.0.1@jar
|    +--- com.android.support:customtabs:25.3.1@aar
|    |    +--- com.android.support:support-compat:26.0.1@aar
|    |    |    \--- com.android.support:support-annotations:26.0.1@jar
|    |    \--- com.android.support:support-annotations:26.0.1@jar
|    +--- com.parse.bolts:bolts-android:1.4.0@jar
|    |    +--- com.parse.bolts:bolts-tasks:1.4.0@jar
|    |    \--- com.parse.bolts:bolts-applinks:1.4.0@jar
|    |         \--- com.parse.bolts:bolts-tasks:1.4.0@jar
|    \--- com.google.zxing:core:3.3.0@jar

I want to use latest appcompat library as I want to support Oreo. Can someone guide me on this? Also, isn't this facebook's fault to use older dependency for custom tabs? Thank you very much for your time and assistance in this matter.


回答1:


Facebook SDK for Android is using support library version 25.3.1, so you need to exclude it to use the most recent support library. You can try using the following:

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



回答2:


For facebook-android-sdk:4.28.0 the list is a bit longer ;)

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'
}


来源:https://stackoverflow.com/questions/46212449/facebook-sdk-dependency-conflict

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!