Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle looking for aar in wrong project's lib folder

I have an Android application made up of multiple projects. One of those projects is an App project that just extends the Application object.

Inside the build.gradle for that app project, I add other projects as dependencies.

I've just created a new module to house an SDK (aar) I want to use. I've also added it to my app project's build.gradle.

compile project(':newmodule-thesdk')

Inside the libs folder of newmodule-thesdk, I have added the aar file. We'll call it thesdk.aar.

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    compile(name:'thesdk-1.0', ext:'aar')
}

When I attempt to sync gradle, the sync fails because thesdk-1.0 does not exist in the libs folder of my app project. Why is it looking for it there? Why is it not just finding it in the newmodule-thesdk project?

like image 344
Andrew Avatar asked Jan 27 '16 16:01

Andrew


1 Answers

It appears solving the problem required me to do the following in my App project's build.gradle.

    repositories {
        flatDir {
            dirs project(':newmodule-thesdk').file('libs')
        }
    }
like image 115
Andrew Avatar answered Sep 25 '22 16:09

Andrew