当我们的android项目引用了别的项目时(例引用了actionbarsherlock项目),项目前边顶着一个大红叉,但是项目中的所有具体文件却没有错误,并且在控制台报“Jar mismatch!”。
经查是因为两个项目引用了不同的jar包(例android-support-v?.jar),导致编译时冲突时系统报错:“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.”,并且在引用了外部项目后Android Private Libraries连带libs中的jar包(例android-support-v?.jar)引用会消失。
具体的解决办法:统一两个项目的引用jar包(例android-support-v?.jar),可以将外部项目的jar包(例android-support-v?.jar)覆盖当前项目中的jar包(android-support-v?.jar)。