how to include lvl-license project with android gradle project
-
21-12-2019 - |
Question
I have an android gradle project it's now not compiling because it's looking for license classes so i tried to include them as following in my build.gradle:
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
**compile project(':lvl-licensing').projectDir = new File(projectDir, '../lvl-licensing/library'**)
}
problem is that for some reason i still get this:
A problem occurred evaluating project ':myproject'.
> Project with path ':lvl-licensing' could not be found in project ':myproject'.
how can i include the lvl-license/library
project in my project using gradle
? why is it complaining? I do have the project in that folder with build.gradle
and I can compile that lvl-license/library
project separately.
thanks
Solution
You have to add the lvl-licensing
file to your settings.gradle
file as well. Also, that library can't be outside the root directory of your project; it looks like you're trying to place the library in a sibling directory to your project.
If you put the library under your project root, you don't need to do the gymnastics with the path in your compile project
statement.