Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle "compile fileTree" not working when src in module

I use IDEA. My gradle config is this:

gradle config

The point is compile fileTree(dir: 'libs', include: ['*.jar']).

And this is my project structure:

project structure

Then I found compile fileTree is not working when java file is in module 'main', but when the java file is under main project, it is working. How can I get the config valid on module 'main'?

like image 894
Gabriel.ge Avatar asked Nov 28 '25 13:11

Gabriel.ge


1 Answers

Oh,god!I know why. NOTE: "dir" is relative to the project root, if you add the dependencies to your android project, 'libs' would need to be in the android/ directory. If you added the dependencies in the core project, 'libs' would need to be in the core/ directory.

So,the libs must in module "main",then is done.

like image 198
Gabriel.ge Avatar answered Nov 30 '25 01:11

Gabriel.ge