How do I add a library project to Android Studio?

前端 未结 30 3898
梦谈多话
梦谈多话 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-21 05:13

    I have just found an easier way (rather than writing directly into the .gradle files).

    This is for Android Studio 1.1.0.

    1. Menu File -> New Module...:

      Import Existing Project

      Click on "Import Existing Project".

    2. Select the desired library and the desired module.

    3. Click finish. Android Studio will import the library into your project. It will sync gradle files.

    4. Add the imported module to your project's dependencies.

      Right click on the app folder -> Open Module settings -> go to the dependencies tab -> Click on the '+' button -> click on Module Dependency.

      The library module will be then added to the project's dependencies.

      Add library module

    5. ???

    6. Profit

提交回复
热议问题