[英]Adding a dependency to Android project for jar
I'm attempting to integrate Localytics into my Android project. 我正在尝试将Localytics集成到我的Android项目中。 Their steps for integration include:
他们的集成步骤包括:
Add a dependency to your project for the jar.
How do I do that? 我怎么做?
using gradle : 使用gradle:
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile name: 'gson-2.2.4'
}
PROJECT_NAME/app/libs/example.jar
PROJECT_NAME / app / libs / example.jar
Add the .jar file to your dependencies in the gradle file. 将.jar文件添加到gradle文件中的依赖项中。
dependencies { compile files('libs/example.jar') }
If you are using Android studio, switch to "Project" view, locate the Jar(s) you want to add as dependency. 如果您使用的是Android Studio,请切换到“项目”视图,找到要添加为依赖项的Jar。 Right click on the Jars and select "Add as Library".
右键单击Jars,然后选择“添加为库”。
PS: To open the "Project" view. PS:打开“项目”视图。 Use the menu View > Tool Windows > Project
使用菜单视图>工具窗口>项目
Finally make sure that you see the folling in app/build.gradle 最后确保您在app / build.gradle中看到了问题
dependencies { compile files('libs/localytics.jar') } 依赖项{编译文件('libs / localytics.jar')}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.