我想包括外部项目作为模块在我的应用程序,但我希望他们的路径是相对的。包含项目作为模块与相对路径
我已经试过如下:
settings.gradle
include ':MyLibrary1'
project(':MyLibrary1').projectDir = new File(settingsDir, '..\\Library\\MyLibrary1')
include ':MyLibrary2'
project(':MyLibrary2').projectDir = new File(settingsDir, '..\\Library\\MyLibrary2')
include ':MyLibrary3'
project(':MyLibrary3').projectDir = new File(settingsDir, '..\\Library\\MyLibrary3')
include ':MyLibrary4'
project(':MyLibrary4').projectDir = new File(settingsDir, '..\\Library\\MyLibrary4')
build.gradle
compile project(path: ':MyLibrary1')
compile project(path: ':MyLibrary2')
compile project(path: ':MyLibrary3')
compile project(path: ':MyLibrary4')
但我得到这个错误:Error:Configuration with name 'default' not found.
你可以发布你的项目的结构?库文件夹中是否有模块build.gradle文件? –