如何在android-studio导入库?

时间:2013-07-26 02:21:48

标签: android api reference module android-studio

我正在使用'android studio'而且我是初学者。 但我不能也不知道如何使用它。

啊,我正在使用8位窗口,现在我想使用“https://github.com/square/android-times-square”。

直到现在我使用'项目结构 - >模块 - > + - >导入模块 - > android-time-square-master(unpacked)\ library(Unmark test and select 3) - >转到'也许(这是我的项目名称,但也存在MaybeProject)' - >去依赖 - > + - >图书馆 - > Java - > android-time-square-master.zip(取消标记测试),然后应用,确定'

然后转到我的layout.xml填写代码,填写他们对我说的活动,但它不起作用。

真的很抱歉,你能一步一步说出来吗? T.T

我希望制作显示日历的活动。帮我。谢谢,真的非常感谢提前。

1 个答案:

答案 0 :(得分:0)

Android Studio使用Gradle进行构建。 2.2版本应该选择build.gradle文件中指定的所有库。但是,如果在“项目结构”对话框中更改了任何内容,则不会更新build.gradle文件。

打开

-project_root
    -module_root
        build.gradle

此文件不应为空。 project_root文件夹中还有另一个空的build.gradle,所以不要混淆它们。在依赖关系中添加所需的所有库。不要将依赖关系与buildscript.dependencies混淆。

apply plugin: 'android'

repositories {
    mavenCentral()
}

dependencies {
    compile files('libs/android-support-v4.jar')
    //here is depenency from Maven Central Repository
    compile 'org.roboguice:roboguice:2.0'
    //here is dependency from your local libs folder
    compile files('libs/mylib.jar')
}