Android工作室中的外部库

时间:2016-06-22 10:47:05

标签: android

我想添加外部库“

github.com/AnderWeb/discreteSeekBar

“到我的Android应用程序。

我尝试使用Gradle同步,我也试过这个例子。

enter image description here

enter image description here

导入此lib以进行布局的任何其他方法? 如果我有代理连接可能会有问题吗?

我使用android studio 2.1.2。

2 个答案:

答案 0 :(得分:1)

如果只是添加到项目中的外部库,请按照以下步骤操作:

  1. 复制外部库并粘贴到app文件夹中的 libs 文件夹中。
  2. 如果你看不到libs文件夹,那么改变你的左下角 android to project 的下拉菜单。然后你可以看到libs文件夹。
  3. 转到app gradle并为您的外部库添加依赖关系

    编译文件(' libs / your_external_library')

  4. 为您的项目提供支持。

    它为我工作。

答案 1 :(得分:0)

添加此

dependencies {
compile 'org.adw.library:discrete-seekbar:1.0.1'
}
在build.gradle文件中。它在github repo的自述文件部分中提到。图书馆。看看这些东西提供的文档总是有帮助的,只需要我的两分钱。

还要检查是否添加了

repositories {
jcenter()
}
在YourProject-> build.gradle