How do I add a library project to Android Studio?

前端 未结 30 3999
梦谈多话
梦谈多话 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:56

    Use menu File -> Project Structure -> Modules.

    I started using it today. It is a bit different.

    For Sherlock, maybe you want to delete their test directory, or add the junit.jar file to the classpath.

    To import the library using gradle, you can have to add it to the dependencies section of your build.gradle (the module's one).

    E.g.

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:22.1.0'
        compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar'
    }
    

    Android Studio is changing.

    There exist a section named "Open module settings" if you right-click on a module folder in the project section of Android Studio (I'm using the version 0.2.10).

提交回复
热议问题