2015-06-19 103 views
0

我想将此library添加到我的项目中,因为我想在其中的某个类中更改某些内容。这就是为什么我将它作为依赖关系添加到我的渐变设置中是不够的。如何在我的项目中包含GitHut库(Android Studio)

我知道在库中它说:“如果你想使用这个库,你只需要下载MaterialDesign项目,将它导入到你的工作区,并将项目作为一个库添加到你的android项目设置中。”但是,这是什么意思,我应该复制所有文件,并将它们放在我的libs文件夹中?

回答

3

报价the documentation

If you want use this library, you only have to download MaterialDesign project, import it into your workspace and add the project as a library in your android project settings.

第1步:下载项目,无论是通过ZIP文件的GitHub为您提供或使用git克隆库

第2步:将MaterialDesign/目录到您的项目目录,作为您现有的app/模块

的同行步骤#3:将您的项目目录中的settings.gradle修改为包括德:MaterialDesign在模块列表建立

第4步:在您的app模块的build.gradle文件,添加compile project(':MaterialDesign')dependencies

+0

感谢您快速评论。我做了第一步和第二步,但现在我不知道如何在我的Gradile中完全添加:MaterialDesign。它是Gradile模块文件还是项目文件? –

+1

@GeorgiKoemdzhiev:'settings.gradle'是一个文本文件。您可以在Android Studio或您最喜爱的文本编辑器中打开它。最有可能的是,它将包含一行“include”:app''。将其编辑为'include':app',':MaterialDesign''。保存修改后的文件。你已经完成了第3步。 – CommonsWare

+0

是否做到了。现在,当我尝试在步骤4中同步gradle时,它会显示“错误:未找到名称为'default'的配置”。 这是我的依赖什么样子: 依赖{ 编译文件树(导演: '库',包括:[ '的* .jar']) 编译“com.android.support:appcompat-v7:22.2.0 ' compile'c​​om.android.support:recyclerview-v7:22.2.0' compile'c​​om.gineub.navasmdc:MaterialDesign:[email protected]' compile project(':MaterialDesign') compile'c​​om.nineoldandroids:library :2.4。+' } –

相关问题