如何使用在Android Studio中库项目
您好我一直在试图这个库项目添加到Android的工作室我现有的项目。它的第一次,我将使用一个库项目,我有艰难的时间。环顾四周,周围的教程和帖子中的方法,但不能把它做。
Hi I have been trying to add this library project to my existing project in Android studio. Its the first time I am going to use a library project and I am having tough time. looked around for may ways from tutorials and posts around but couldn't get it done.
我希望我不能从这个美好的社会,我的一部分获得帮助。
I hope I cant get help from this wonderful community I am a part of.
我不知道,如果它已经可以通过IDE添加库项目( - >没有任何问题)。
我通过配置我的项目的文件的gradle这样做:
I'm not sure if it's already possible to add a library project via the IDE (-> without any problems). I do this by configuring the gradle files of my project like this:
- 在命名您的项目根目录创建一个文件夹
库
- 文件夹复制
的DateTimePicker库
到库
-
在添加此库中的
settings.gradle
使用以下命令:
include ':libs:datetimepicker-library'
去你的的build.gradle
文件的 AppProject
键,下面的行添加到您的依赖
:
go to your build.gradle
file of your AppProject
and add the following line to your dependencies
:
compile project(':libs:datetimepicker-library')
你至少要同步您的文件的gradle:工具 - > Android的 - >同步工程与摇篮文件
at least you have to sync your gradle files: Tools -> Android -> Sync Project with Gradle Files
请试试这个。如果出现错误,请张贴日志文件。
Please try this. If you get errors please post the log file.