我想包括外部項目作爲模塊在我的應用程序,但我希望他們的路徑是相對的。包含項目作爲模塊與相對路徑
我已經試過如下:
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文件? –