1. 程式人生 > >解決android-support-v4.jar 衝突

解決android-support-v4.jar 衝突

出現此問題的場景為:在專案匯入多個jar包時,由於在其他jar包中也同樣包含android-support-v4.jar,並且匯入的版本不是同一時間的,導致衝突。

[2015-12-30 16:13:26 - App] Found 4 versions of android-support-v4.jar in the dependency list,
[2015-12-30 16:13:26 - App] but not all the versions are identical (check is based on SHA-1 only at this time).
[2015-12-30 16:13:26 - App] All versions of the libraries must be the same at this time.
[2015-12-30 16:13:26 - App] Versions found are:
[2015-12-30 16:13:26 - App] Path: D:\Codes\App-Android\branches\eacher\App\libs\android-support-v4.jar
[2015-12-30 16:13:26 - App] Length: 621451
[2015-12-30 16:13:26 - App] SHA-1: 5896b0a4e377ac4242eb2bc785220c1c4fc052f4
[2015-12-30 16:13:26 - App] Path: D:\Codes\App-Android\branches\teacher\App-master\App\src\main\libs\android-support-v4.jar
[2015-12-30 16:13:26 - App] Length: 621451
[2015-12-30 16:13:26 - App] SHA-1: 5896b0a4e377ac4242eb2bc785220c1c4fc052f4
[2015-12-30 16:13:26 - App] Path: D:\Codes\App-Android\branches\teacher\App-master\library\libs\android-support-v4.jar
[2015-12-30 16:13:26 - App] Length: 349252
[2015-12-30 16:13:26 - App] SHA-1: 612846c9857077a039b533718f72db3bc041d389
[2015-12-30 16:13:26 - App] Path: D:\Codes\App-Android\branches\teacher\library-App\libs\android-support-v4.jar
[2015-12-30 16:13:26 - App] Length: 621451
[2015-12-30 16:13:26 - App] SHA-1: 5896b0a4e377ac4242eb2bc785220c1c4fc052f4
[2015-12-30 16:13:26 - App] Jar mismatch! Fix your dependencies

解決方法:複製其中一個jar包中的android-support-v4.jar,然後複製到起衝突的所有jar包中,覆蓋掉原來的android-support-v4.jar檔案,再clear一遍就可以了。