在eclipse中添加库项目时出错 [英] Error on add library project in eclipse

查看:27
本文介绍了在eclipse中添加库项目时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Eclipse 中添加了库项目.但是我遇到了以下错误

I added library project inside eclipse. But i got following error

[2012-10-09 11:25:38 - Share] Found 2 versions of android-support-v4.jar in the dependency list,
[2012-10-09 11:25:38 - Share] but not all the versions are identical (check is based on SHA-1 only at this time).
[2012-10-09 11:25:38 - Share] All versions of the libraries must be the same at this time.
[2012-10-09 11:25:38 - Share] Versions found are:
[2012-10-09 11:25:38 - Share] Path: D:android 4 toolswork1Sharelibsandroid-support-v4.jar
[2012-10-09 11:25:38 - Share]   Length: 349252
[2012-10-09 11:25:38 - Share]   SHA-1: 612846c9857077a039b533718f72db3bc041d389
[2012-10-09 11:25:38 - Share] Path: D:android 4 toolswork1Android-Featherlibsandroid-support-v4.jar
[2012-10-09 11:25:38 - Share]   Length: 337562
[2012-10-09 11:25:38 - Share]   SHA-1: 27c24d26e4c5d57976e6926367985548678e913c
[2012-10-09 11:25:38 - Share] Jar mismatch! Fix your dependencies

推荐答案

在库和主项目中使用相同的 android-support-v4.jar 库.

Use same android-support-v4.jar library in both library and your main project.

为此,从库和主要项目构建路径中删除 android-support-v4.jar 文件,然后从您的目录中删除 android-support-v4.jar库路径.然后在库和主项目中重新插入相同的 android-support-v4.jar.然后使用 add to build path 将 lib 添加到您的项目中.

To do this remove android-support-v4.jar file form both library and your main projects build path and then remove android-support-v4.jar from your libs path. Then reinsert same android-support-v4.jar in both library and main project. Then use add to build path to add lib to your projects.

这将解决您的问题.

如何在项目中添加支持库:

要将最新的支持库添加到您的 android 项目,请执行以下步骤:

To add latest support lib to your android project do these steps :

  1. 右键单击您的 android 项目.
  2. 选择Android 工具
  3. 然后选择添加支持库

然后按照屏幕说明操作,这会将最新的支持库添加到您的 libs 文件夹中.

Then follow the screen instructions and this will add latest support library to your libs folder.

现在右键单击 libs 文件夹中的 android-support-v4.jar 文件并将其添加到我描述的构建路径中.您的项目中将拥有最新的支持库.

Now right click on android-support-v4.jar file in libs folder and Add it to build path as I described. You will have the latest support lib in your project.

更新正如Doctoror Drive"所说,您只需要在library project 中添加support library.因此,只需将 support library 添加到您的 library project.

UPDATE As 'Doctoror Drive' said you only need to add support library in your library project. So only add support library to your library project.

这篇关于在eclipse中添加库项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆