我创建了一个应用程序,需要使用两个不同的 Android 支持库,因为我使用的方法在一个库中不可用。我使用的一个库是用于滑动菜单的 ABS,第二个是ActionBarSherelock 两者都使用不同的 android 支持库。当我在项目中使用两者时,我收到此错误。
日志猫:
Found 2 versions of android-support-v4.jar in the dependency list,
\[2014-01-13 11:26:17 - phoneCall\] but not all the versions are identical (check is based on SHA-1 only at this time).
\[2014-01-13 11:26:17 - phoneCall\] All versions of the libraries must be the same at this time.
\[2014-01-13 11:26:17 - phoneCall\] Versions found are:
\[2014-01-13 11:26:17 - phoneCall\] Path: /root/AndroidHome/AndroidWorkspace/ActionBarSherlock/libs/android-support-v4.jar
\[2014-01-13 11:26:17 - phoneCall\] Length: 385685
\[2014-01-13 11:26:17 - phonecall\] SHA-1: 48c94ae70fa65718b382098237806a5909bb096e
\[2014-01-13 11:26:17 - phone91\] Path: /root/AndroidHome/AndroidWorkspace/ABS/libs/android-support-v4.jar
\[2014-01-13 11:26:17 - phoneCall\] Length: 484258
\[2014-01-13 11:26:17 - phoneCall\] SHA-1: bd6479f5dd592790607e0504e66e0f31c2b4d308
\[2014-01-13 11:26:17 - phoneCall\] Jar mismatch! Fix your dependencies
我已提及this解决方案并尝试解决,但在 mainactivity 上显示错误
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout
请告诉我如何解决这个问题。
最佳答案
确保应用程序中的 android-support-v4.jar
和 ActionBarSherlock
应用程序中的内容相同,因此请从 ABS 库复制 android-support-v4.jar并在您的项目中使用它。
按照以下步骤操作,
- 转到 ABS 项目的 lib 文件夹并复制 android-support-v4.jar 文件
- 将 .jar 文件粘贴到当前项目中
- 清理并刷新项目
关于android - JAR 不匹配!修复使用两个库时的依赖错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21084983/