重现步骤:
- 创建一个Android项目“ 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