web-dev-qa-db-ja.com

Facebook SDKの依存関係の競合

私はこのエラーが発生しています:

enter image description here

依存関係ツリーを取得すると、アニメーション化されたベクターのドロアブルには何も問題はありませんが、facebookの最新のSDKには以前のバージョンのsupport-v4カスタムタブがあります。 exclude groupコマンドで除外しようとしましたが、機能しません。これが私の依存関係ツリーです。

 +--- 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

Oreoをサポートしたいので、最新のappcompatライブラリを使用します。誰かがこれについて私を案内できますか?また、このfacebookの欠点は、カスタムタブに古い依存関係を使用することではないでしょうか?この件についてお時間をいただきありがとうございます。

16
Rushi M Thakker

Facebook SDK for Android はサポートライブラリバージョン25.3.1を使用しているため、最新のサポートを使用するには除外する必要があります図書館。次を使用して試すことができます。

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

facebook-Android-sdk:4.28.の場合、リストは少し長くなります;)

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'
}
21
Jordan Silva