Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referencing a flatDir from library module

My project contains one main module ('app') and one library module ('mylibrary'). In my library I have a libs folder, which contains an aar file to a library that I want to use in my 'library' module. I'm referencing my aar library using the following gradle script:

repositories{
   flatDir{
     dirs 'libs'
   }
}

dependencies{
   compile(name:'nameOfAar', ext:'aar')
}

This doesn't help it's trying to look in the mavenCentral for the aar library, but doesn't want to look in the flat directory that I've specified. Does anybody got any clue, how can I reference an aar library from an library module?

like image 278
AngryChicken Avatar asked Jul 12 '26 14:07

AngryChicken


1 Answers

I had the same problem but unfortunately the only solution that I found is to add '../<library_dir>/libs' to build.gradle of the app

repositories {
    flatDir {
        dirs 'libs', '../<library_dir>/libs'
    }
}
like image 54
Mattia Maestrini Avatar answered Jul 14 '26 06:07

Mattia Maestrini