Include projects as modules with relative path

后端 未结 2 1922
情话喂你
情话喂你 2021-01-23 05:34

I am trying to include external projects as modules in my app, but I want their path to be relative.

What I\'ve tried is the following:

settings.gradle

2条回答
  •  有刺的猬
    2021-01-23 05:53

    Error:Configuration with name 'default' not found

    It happens when gradle is looking for a module build.gradle and it can't find it.

    Make sure that you are referring to the module inside the Library not the root folder.

    MyLibrary1
    |--settings.gradle
    |--build.gradle
    |--module
    |----build.gradle
    

    If you have a structure like this you have to refer to \\Library\\MyLibrary1\module instead of \\Library\\MyLibrary1

    In your settings.gradle use:

    include ':MyLibrary1'
    project(':MyLibrary1').projectDir = new File(settingsDir, '..\\Library\\MyLibrary1\module')
    

提交回复
热议问题