简体   繁体   中英

Android android-support-v4.jar missmatch

When i create a new project into the eclipse i got the following error.

[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.


As pointed out by EugenPechanec, you don't need the jar file in both projects. 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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM