简体   繁体   English

Android android-support-v4.jar失配

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

相关问题 android-support-v4.jar在Eclipse中无法正确导入 - android-support-v4.jar isn't importing correctly in Eclipse Jar Mismatch在依赖项列表中找到了2个版本的android-support-v4.jar - Jar Mismatch Found 2 versions of android-support-v4.jar in the dependency list 导入3个SDK,得到错误:找到3个版本的android-support-v4.jar - Import 3 SDKs, get error: Found 3 versions of android-support-v4.jar Json类型Missmatch,Android - Json type Missmatch,Android Android应用程序未与Facebook SDK 3.6一起启动,但出现一些Android支持v4 jar文件问题 - Android app is not launching with facebook SDK 3.6 getting some android support v4 jar file issue 在Android 4.4 SDK更新后,android-support-v7-appcombat jar不匹配和应用程序崩溃 - android-support-v7-appcombat jar mismatch and app crashing after Android 4.4 SDK update 带有Java项目的Eclipse中缺少工件com.android.support:appcompat-v7:jar:23.0.1 - Missing artifact com.android.support:appcompat-v7:jar:23.0.1 in Eclipse with a Java project 支持JAVA-8 Jar in Android 5 - React Native - Support JAVA-8 Jar in Android 5 - React Native android.support.v7.widget.AppCompatEditText错误 - android.support.v7.widget.AppCompatEditText Error android-support-v4删除未使用的类 - android-support-v4 remove unused classes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM