重现步骤:
- 创建一个安卓项目“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:\Users\santhosh\My_Workspace\DVP_library\libs\android-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:\Users\santhosh\My_Workspace\abs_library\libs\android-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 时,它给了我以下错误。
Problems encountered while deleting resources.
Could not delete 'C:\Users\santhosh\My_Workspace\MyApp\libs\android-support-v4.jar'.
当我尝试从ABS删除 android-support-v4.jar 时,它给了我以下错误
????? cannot be resolved to a type error.
我试图清理项目,修复项目属性。重启eclipse,再次构建,导入并添加。我试图将 libs 文件夹中的支持 jar 从一个库复制到另一个库。删除两个库中的支持 jar 并将其添加到 MyApp 项目中。没有什么对我有用。
如果我尝试添加单个库,它工作正常。尝试将 2 个或更多库添加到单个项目时,我遇到了问题。
在 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