安卓问题报告小记(三):Jar mismatch! Fix your dependencies

在开发Android项目的时候,有时需要引用多个项目作为library。在引用项目的时候,有时会出现“Jar mismatch! Fix your dependencies”错误,具体如下:

Found 2 versions of android-support-v4.jar in the dependency list,

 but not all the versions are identical (check is based on SHA-1 only at this time).

 All versions of the libraries must be the same at this time.

 Versions found are:

 Path: /Users/***/libs/android-support-v4.jar

  Length: 484258

  SHA-1: bd6479f5dd592790607e0504e66e0f31c2b4d308

 Path: /Users/***/libs/android-support-v4.jar

  Length: 385685

  SHA-1: 48c94ae70fa65718b382098237806a5909bb096e

 Jar mismatch! Fix your dependencies

这是因为两个项目的jar包(android-support-v4.jar)不一致。

解决之道一:

解决方法是把2个jar都删除,然后各自加上最新的jar包。


解决之道二:

把两个项目的 android-support-v4.jar 删一个,复制过去。这样2个jar 包就一致了。

解决之道三:

把其他项目中的v4jar包,拿出来分别放到这两个项目中去。

原文地址:https://www.cnblogs.com/jscitlearningshare/p/4340644.html