Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
281 views
in Technique[技术] by (71.8m points)

android - Facebook SDK dependency conflict

I am having this error:

enter image description here

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...