无法在Android的Studio加载外部库? [英] Can't add External Library in Android Studio?

查看:393
本文介绍了无法在Android的Studio加载外部库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了一个外部库到我的项目按照
<一href=\"http://stackoverflow.com/questions/20241765/adding-external-library-in-android-studio-0-3-6\">this方法。并尝试这种方法太<一个href=\"http://stackoverflow.com/questions/16588064/how-do-i-add-a-library-project-to-the-android-studio\">this方法太。
摇篮构建得成品和我得到这个行添加到我的的build.gradle

I Added a External Library to my project by following this method. and tried this method too this method too. Gradle build got Finished and i got this line added to my build.gradle

compile 'com.github.castorflex.smoothprogressbar:library-circular:1.0.1'

现在我试图导入该库在我的课。但我无法做到这一点。我接过一看文件,它们位于下生成目录爆炸-AAR 。所以我说 @aar 来编译行。仍然没有改变。

Now i am trying to import this library in my class. But i can't do this. I took a look at the files and they are located in the build directory under the exploded-aar. so i added @aar to the compile line. Still there are no changes.

如何导入这个库来我班或者我错了?

How can i import this library to my class or where i am going wrong?

由于提前

推荐答案

好了,你不需要下载任何内容或指向你的依赖到文件中。

Well, you don't need to download anything or point your dependency to a file.

这依赖,因为大多数使用的依赖关系,可以从<一个自动获取href=\"https://bintray.com/bintray/jcenter?filterByPkgName=com.github.castorflex.smoothprogressbar%3Alibrary-circular\">JCenter, Java和Android组件最大的资料库。

This dependency, as most of the dependencies you use, can automatically fetched from JCenter, biggest repository for Java and Android components.

所有你需要做的是:


  1. 添加JCenter为你的依赖资源库。

  2. 定义你所需要的图书馆圆形依赖。这可以被发现和从JCenter特别包/版本的文件图标复制/粘贴。

  3. 您的摇篮构建文件重新同步你的Andr​​oid Studio项目。这是Android Studio中摇篮窗格中的同步按钮。

  1. Add JCenter as your dependencies repository.
  2. Declare that you need the library-circular dependency. This can be found and copy/pasted from the file icon in particular package/version in JCenter.
  3. Resync your Android Studio project with your Gradle build file. This is the 'sync' button in Gradle pane in Android Studio.

下面就是你的的build.gradle 应包括:

repositories {
    jcenter()
}

dependencies {
    compile(group: 'com.github.castorflex.smoothprogressbar', name: 'library-circular', version: '1.0.1', ext: 'aar')
}

这篇关于无法在Android的Studio加载外部库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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