Android studio add external project to build.gradle

后端 未结 6 1954
半阙折子戏
半阙折子戏 2020-11-22 16:16

I have a sample project, with the following setup:

/root
  + Pure Java Lib
  + Android Test Lib
  + Android Test Project

Where the \'Te

6条回答
  •  死守一世寂寞
    2020-11-22 16:52

    You have to put in your file settings.gradle this lines:

    include ':module2'
    project(':module2').projectDir = new File(settingsDir, '../Project 2/Module2')
    

    Then you have to add in your builde.gradle (Module: app) in the dependencies tree, this line:

    implementation project(':module2')
    

    or go into the Project Structure > app > Dependencies, click on Add, choose 3 Module Dependencies and select your module

提交回复
热议问题