How do I add a library project to Android Studio?

前端 未结 30 4000
梦谈多话
梦谈多话 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 04:53

    Open the build gradle module app file and add your dependency. If you download the library, just import and build as gradle.

    Otherwise add repositories in side gradle module app:

    repositories {
            maven { url 'http://clinker.47deg.com/nexus/content/groups/public' }
    }
    

    The first repositories will download the library for you.

    And compile the downloaded library:

     compile ('com.fortysevendeg.swipelistview:swipelistview:1.0-SNAPSHOT@aar') {
            transitive = true
        }
    

    If you are creating a library, you just need to import the project as import new module.

提交回复
热议问题