How do I add a library project to Android Studio?

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

    The easiest way I found to include external library project is (for example to include a Facebook library which is stored one directory up in the dependencies folder):

    1. In settings.gradle add

      include ':facebook'
      
      project(':facebook').projectDir = new File(settingsDir, '../dependencies/FacebookSDK')
      
    2. In build.gradle dependencies section, add

      compile project ('facebook')
      

    All left to do is synchronise the project with gradle files.

提交回复
热议问题