[英]Android android-support-v4.jar missmatch
When i create a new project into the eclipse i got the following error. 当我在Eclipse中创建一个新项目时,出现以下错误。
[2015-02-01 19:34:09 - test] Found 2 versions of android-support-v4.jar in the dependency list,
[2015-02-01 19:34:09 - test] but not all the versions are identical (check is based on SHA-1 only at this time).
[2015-02-01 19:34:09 - test] All versions of the libraries must be the same at this time.
[2015-02-01 19:34:09 - test] Versions found are:
[2015-02-01 19:34:09 - test] Path: C:\Android\Workspace\test\libs\android-support-v4.jar
[2015-02-01 19:34:09 - test] Length: 995624
[2015-02-01 19:34:09 - test] SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-02-01 19:34:09 - test] Path: C:\Android\Workspace\appcompat_v7\libs\android-support-v4.jar
[2015-02-01 19:34:09 - test] Length: 987314
[2015-02-01 19:34:09 - test] SHA-1: 9b6a9a9078af571732159b904ad423b03b7cc786
[2015-02-01 19:34:09 - test] Jar mismatch! Fix your dependencies
You are using one version in your main project, and a another version in a library. 您在主项目中使用一个版本,而在库中使用另一个版本。
Copy the jar file from one project into the other, and rebuild. 将jar文件从一个项目复制到另一个项目,然后重新生成。
As pointed out by EugenPechanec, you don't need the jar file in both projects. 正如EugenPechanec指出的,在两个项目中都不需要jar文件。 So just make sure your library project has a copy (the latest version of the jar), and your main project will pick up from there.
因此,只需确保您的库项目有一个副本(jar的最新版本),您的主项目就会从那里开始。
Basically if you are using appcompat v7 you also need to include android support v4 in your build path, it's a requirement of appcompat. 基本上,如果您使用的是appcompat v7,则还需要在构建路径中包括android support v4,这是appcompat的要求。
It seems that you also have a testing project, it should only add new libraries, which are only for testing. 看来您也有一个测试项目,它应该只添加新的库,这些库仅用于测试。 In most case you only need to add a dependency to your main project and mark other libraries, like android support v4 in your case, as "exported" in your IDE's dependency management window, so they will also be available for your testing project.
在大多数情况下,您只需要在主项目中添加一个依赖项,然后在IDE的依赖项管理窗口中将其他库(例如您的案例中的android support v4)标记为“已导出”,因此它们也可用于您的测试项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.