6

Tôi gặp lỗi này:Facebook SDK phụ thuộc xung đột

enter image description here

On nhận cây phụ thuộc, tôi thấy rằng không có gì sai với drawables vector hoạt hình là nhưng sdk mới nhất facebook của có phiên bản trước của hỗ trợ-v4 tùy chỉnh chuyển hướng. Tôi đã thử loại trừ với lệnh loại trừ nhóm nhưng nó không hoạt động. Đây là cây phụ thuộc của tôi:

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

Tôi muốn sử dụng thư viện appcompat mới nhất như tôi muốn hỗ trợ Oreo. Ai đó có thể hướng dẫn tôi về điều này? Ngoài ra, không phải là lỗi của facebook này để sử dụng phụ thuộc cũ hơn cho các tab tùy chỉnh? Cảm ơn bạn rất nhiều vì đã dành thời gian và hỗ trợ cho vấn đề này.

Trả lời

14

Facebook SDK for Android đang sử dụng phiên bản thư viện hỗ trợ 25.3.1, vì vậy bạn cần loại trừ nó để sử dụng thư viện hỗ trợ gần đây nhất. Bạn có thể thử bằng cách sử dụng sau đây:

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

Cảm ơn rất nhiều !! Nó đã làm việc. Nhưng cây phụ thuộc chỉ ra rằng chỉ có customtabs là 25.3.1. Tại sao facebook lại ngủ? Bất kỳ ý tưởng? –

+0

imho, mã trên chỉ là một cách đơn giản để đảm bảo thư viện hỗ trợ xung đột không được bao gồm cho phiên bản facebook sdk 4.26.0. Bạn có thể thử loại trừ chỉ customtabs. Tôi xin lỗi, tôi thực sự không hiểu được lý do tại sao facebook lại ngủ? Bạn có thể xây dựng nó nhiều hơn? –

+0

Tôi đã thử cho customtabs nó không hoạt động. Về việc ngủ facebook, chỉ là một trò đùa thôi. Tôi có nghĩa là tại sao họ đã không nâng cấp phụ thuộc trong sdk của họ. –

10

Đối facebook-android-sdk: 4.28.0 danh sách là lâu hơn một chút;)

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

Bất kỳ giải pháp nào cho 4.29.0? Nó đi kèm với 27.0.1 nhưng hỗ trợ cuối cùng là 27.0.2, vì vậy nếu tôi loại trừ com.android.support từ sdk Facebook như trong 4,28.0 nó trả về một số lỗi dễ bị tấn công: (-> ... /. Gradle/cache/transforms -1/files-1.1/facebook-common-4.29.0.aar/be3a9d27cd44a8128aadc980156f8f12/res/layout/com_facebook_device_auth_dialog_fragment.xml Tôi cố gắng xóa cache từ gadle nhưng không giúp được – Pelanes

+0

Tôi vừa nâng cấp fb sdk lên 4.30.0 bằng cách sử dụng hỗ trợ thư viện 27.0.2 và nó hoạt động hoàn hảo, chỉ cần phải loại bỏ tất cả các loại trừ và các dòng thực hiện.Vì vậy, có thể làm tương tự nếu bạn không sử dụng nó được nêu ra. –

Các vấn đề liên quan