web-dev-qa-db-ja.com

Facebook SDKの依存関係の競合

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

enter image description here

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

 +--- 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:26.0.1[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]

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