Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
196 views
in Technique[技术] by (71.8m points)

How to use a library project in android studio

I have been trying to add this library project to my existing project in Android Studio. It's the first time I am going to use a library project and I am having tough time. I have looked around for many ways to do this from tutorials and posts around but couldn't get it done.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

  • create a folder in your root project directory named libs
  • copy the folder datetimepicker-library to libs
  • add this library in your settings.gradle with the following command:

    include ':libs:datetimepicker-library'
    
  • go to your build.gradle file of your AppProject and add the following line to your dependencies:

    implementation project(':libs:datetimepicker-library')
    
  • 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...