How do I add a library project to Android Studio?

前端 未结 30 3931
梦谈多话
梦谈多话 2020-11-21 04:24

How do I add a library project (such as Sherlock ABS) to Android Studio?

(Not to the old ADT Eclipse-based bundle, but to the new Android Studio.)

30条回答
  •  眼角桃花
    2020-11-21 05:01

    Android Studio 3.0

    Just add the library name to the dependencies block of your app's build.gradle file.

    dependencies {
        // ...
        implementation 'com.example:some-library:1.0.0'
    }
    

    Note that you should use implementation rather than compile now. This is new with Android Studio 3.0. See this Q&A for an explanation of the difference.

提交回复
热议问题