Link_88
18-02-2018, 10:38
Introduction
I have two project (for simplicity I will use the word "prj"), one main prj (TraderGoal) and one lib prj (NoobLib).
I want to add the lib prj dependency by passing the prj relative path in the setting.gradle like explained here (I have also tried new File(settingsDir, '../Library/NoobLib/app')).
Problem and my code
If I set these values: Main prj App module gradle:
implementation project (':NoobLib')
settings.gradle:
include ':app'
include ':NoobLib'
project(':NoobLib').projectDir = new File(settingsDir, '../Library/NoobLib')
the main prj throws me the following error (notice that two gradle files have been added to the prj and it's strange because I should only have the library module gradle and not that two gradles):
https://i.stack.imgur.com/yu9XH.png
Right setting and wrong behaviour
That is the right way to add the library and that is the way I want to make it works.
How it works (in the wrong way) for me
If I set these values: Main prj App module gradle:
implementation project (':NoobLib-NoobLib')
settings.gradle:
include ':app'
include ':NoobLib-NoobLib'
project(':NoobLib-NoobLib').projectDir = new File(settingsDir, '../Library/NoobLib/app')
Everything works as expected and I can see the library project added as a normal module and I can work with like I want to.
Screenshot:
https://i.stack.imgur.com/I7Xbf.png
I have two project (for simplicity I will use the word "prj"), one main prj (TraderGoal) and one lib prj (NoobLib).
I want to add the lib prj dependency by passing the prj relative path in the setting.gradle like explained here (I have also tried new File(settingsDir, '../Library/NoobLib/app')).
Problem and my code
If I set these values: Main prj App module gradle:
implementation project (':NoobLib')
settings.gradle:
include ':app'
include ':NoobLib'
project(':NoobLib').projectDir = new File(settingsDir, '../Library/NoobLib')
the main prj throws me the following error (notice that two gradle files have been added to the prj and it's strange because I should only have the library module gradle and not that two gradles):
https://i.stack.imgur.com/yu9XH.png
Right setting and wrong behaviour
That is the right way to add the library and that is the way I want to make it works.
How it works (in the wrong way) for me
If I set these values: Main prj App module gradle:
implementation project (':NoobLib-NoobLib')
settings.gradle:
include ':app'
include ':NoobLib-NoobLib'
project(':NoobLib-NoobLib').projectDir = new File(settingsDir, '../Library/NoobLib/app')
Everything works as expected and I can see the library project added as a normal module and I can work with like I want to.
Screenshot:
https://i.stack.imgur.com/I7Xbf.png