Eclipse
在这里我以slidingmenu为例。首先我们导入slidingmenu项目
我们右键查看属性,看其【android】栏目,Eclipse自动帮其勾选了【Is Library】意思就是说这个项目可以供其他项目使用
那么如何去使用这个项目呢。新建项目后我们右键属性,在【android】栏目,【Library】属性中点击【add】
在弹出框中选择可使用的项目
点击【Apply】然后点击OK
这样我们就可以正常使用了开源项目slidingmenu了。我们会发现我们的android项目下Android Dependencies多了一个我们导入slidingmenu的jar包了
如果报错如:Found 2 versions of android-support-v4.jar in the dependency list,but not all the versions are identical (check is based on SHA-1 only at this time).All versions of the libraries must be the same at this time.Versions found are: Path: D:\ProgramData\workspaces\app\library\libs\android-support-v4.jarLength: 385685SHA-1: 48c94ae70fa65718b382a5909bb096ePath: D:\ProgramData\workspaces\app\DingTop\libs\android-support-v4.jarLength: 758727SHA-1: efec67655f6db90757faa37201efcee2a9ec3507Jar mismatch! Fix your dependencies意思是:有2个v4的jar包 且SHA-1不一致.我们需要复制slidingmenu中的v4jar包替换我们项目中的v4jar包。
注意我们项目的运行版本最好为14
然后我们就可以正确使用slidingmenu等一系列的开源项目了