罐子不匹配!修复您的依赖项

编程入门 行业动态 更新时间:2024-10-22 16:22:16
本文介绍了罐子不匹配!修复您的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述
  • 创建一个安卓项目MyApp"
  • 导入 ActionBarSherlock(ABS)、Directional ViewPager(DVP) 或任何其他使用 android 支持库的开源库.
  • 将库添加到项目MyApp"
  • 控制台日志:

    [2013-04-17 14:27:12 - MyApp] Found 2 versions of android-support-v4.jar in the dependency list, [2013-04-17 14:27:12 - MyApp] but not all the versions are identical (check is based on SHA-1 only at this time). [2013-04-17 14:27:12 - MyApp] All versions of the libraries must be the same at this time. [2013-04-17 14:27:12 - MyApp] Versions found are: [2013-04-17 14:27:12 - MyApp] Path: C:UserssanthoshMy_WorkspaceDVP_librarylibsandroid-support-v4.jar [2013-04-17 14:27:12 - MyApp] Length: 140011 [2013-04-17 14:27:12 - MyApp] SHA-1: fc834ac8147bc4ed0b555f90f500a57d4232c448 [2013-04-17 14:27:12 - MyApp] Path: C:UserssanthoshMy_Workspaceabs_librarylibsandroid-support-v4.jar [2013-04-17 14:27:12 - MyApp] Length: 271754 [2013-04-17 14:27:12 - MyApp] SHA-1: 53307dc2bd2b69fd5533458ee11885f55807de4b [2013-04-17 14:27:12 - MyApp] Jar mismatch! Fix your dependencies

    我知道我想从 libs 文件夹中删除 android-support-v4.jar 并且只保留一份副本.但是,这并不能解决我的问题.

    当我尝试从 MyApp 中删除 android-support-v4.jar 时,它给了我以下错误.

    When i try to delete the android-support-v4.jar from MyApp, it gives me the following error.

    Problems encountered while deleting resources. Could not delete 'C:UserssanthoshMy_WorkspaceMyApplibsandroid-support-v4.jar'.

    当我尝试从 ABS 中删除 android-support-v4.jar 时,它给了我以下错误

    When I try to delete the android-support-v4.jar from ABS, it gives me the following error

    ????? cannot be resolved to a type error.

    我尝试清理项目,修复项目属性.重启eclipse,Build,再次导入,添加.我试图将 libs 文件夹中的支持 jar 从一个库复制到另一个库.删除两个库中的支持 jar 并将其添加到 MyApp 项目中.没有什么对我有用.

    I have tried to clean the project, Fix Project Properties. Restart eclipse, Build, import and add again. I have tried to copy the support jar in libs folder from one library to other. delete the support jar in both libraries and add it to the MyApp project. Nothing has worked for me.

    如果我尝试添加单个库,它工作正常.我在尝试将 2 个或更多库添加到单个项目时遇到问题.

    在 MyApp 中添加两个库时出错:

    error getting when I add two libraries in MyApp:

    The project was not built since its build path is incomplete. Cannot find the class file for android.support.v4.app.FragmentActivity. Fix the build path then try building this project MyApp Unknown Java Problem The type android.support.v4.app.FragmentActivity cannot be resolved. It is indirectly referenced from required .class files MyActivity.java/MyApp/src/com/santhosh/myapp line 10 Java Problem Jar mismatch! Fix your dependencies MyApp Unknown Android Dependency Problem

    推荐答案

    为支持库使用一个库项目

    自 ADT 22 起,使用 Eclipse Juno

    Use a Library Project just for the Support Library

    As of ADT 22, using Eclipse Juno

    我认为以上任何一个都不是最好的答案.我也不认为建议再在 Eclipse 中使用 external jar 函数(AFAIK).

    I don't think any of the above are really the best answers. I also don't think it is recommended to use the external jar function in Eclipse anymore (AFAIK).

    相反,对我有用的是创建一个单独的空库项目.

    然后使用 Android tools > Add Support Library 获取您需要或想要的最新版本.

    Then use Android tools > Add Support Library to get the latest version you need or want.

    然后从所有其他项目中删除支持库 jar.

    最后,对于需要它的每个项目,添加对新库项目的引用

    Finally, for every project that requires it, add a reference to your new Library project

    (项目属性) > Android > (库框) > 添加...

    那么您的所有项目都将有一个单一的来源来使用和更新支持库.这也使 javadoc 更容易开始工作.

    Then all your projects will have a single source to use and update the support library. This also makes javadocs easier to get working.

    有关如何设置 javadoc 的信息,请参阅:

    For info on how to setup the javadocs see:

    如何将 javadoc 或源附加到libs文件夹中的jar包?

    更多推荐

    罐子不匹配!修复您的依赖项

    本文发布于:2023-07-14 21:51:58,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1107251.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:您的   罐子   不匹配

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!