184

We recently upgraded to Android Gradle Plugin 4.0.0-beta03. We are now seeing this error when building one of our library modules

$ ./gradlew library_module:assemble

Execution failed for task ':library_module:bundleDebugAar'.
> Direct local .aar file dependencies are not supported when building an AAR. 
The resulting AAR would be broken because the classes and Android resources from any local .aar 
file dependencies would not be packaged in the resulting AAR. Previous versions of the Android 
Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The 
following direct local .aar file dependencies of the :library_module project caused this error: 
______.aar

I can see this was added to AGP a few months ago. But they provide no further info on why.

So.

  1. What was the problem? Any more info? I can't find a single bug report anywhere.
  2. How exactly can I fix this? Is this saying that I can't build one .aar that depends on other local .aars? What if this local aar was instead hosted on Maven Central or another remote repo? Why would that make a difference?
2
  • @[email protected] some comment on this? Commented May 5, 2020 at 23:51
  • 1
    The whole problem is that this would resulted in a kind of fat AAR. Which is not any trivial task, but definitely something Google could do (as they have all the tools for it already working - they are able to merge any number of AARs into the APK), so they probably just do not want to (as the transitive dependencies are more proper way, in most of the cases). There is an existing community solution for this - see github.com/kezong/fat-aar-android - but be warned, it is not mature (e.g. does not support multi-flavour builds, or support for new AGP versions is coming too late, ...). Commented Jun 8, 2022 at 6:25

24 Answers 24

183

I want to call out @StefMa's comment on this question which was incredible simple and solved this issue for me, but it's buried among many other comments on this thread and is easily missed.

The 'correct' answer on this thread no longer works because it's not possible to import AARs in Android Studio anymore as referred to in that answer. But, the solution referred to in StefMa's comment linking to this GitHub post does, and it works perfectly.

Long story short - put your AAR into a separate module.

There's no need to muck around with creating lib directories, just follow these directions -

  1. Create a new directory in your project's root directory. The image below shows two of them - spotify-app-remote and spotify-auth, but one is sufficient. Within that, put your AAR in, and create either a new build.gradle file (if using the old Groovy DSL), or build.gradle.kts (if using the newer Kotlin DSL).

    Folder structure

  2. Within the Gradle file you just created, add the following, replacing the aar filename with the name of your AAR file -

    For build.gradle

    configurations.maybeCreate("default")
    artifacts.add("default", file('spotify-app-remote-release-0.7.1.aar'))
    

    For build.gradle.kts

    configurations.maybeCreate("default")
    artifacts.add("default", file("spotify-app-remote-release-0.7.1.aar"))
    
  3. Add this to your settings.gradle file, substituting the name of the directory you created

    include ':spotify-app-remote'
    

    For settings.gradle.kts

    include(":spotify-app-remote")
    
  4. Include your new module in the module you wish to use the AAR. eg, if you want to use it within your app module, open app's Gradle and add the following into your dependencies { } block, obviously again substituting spotify-app-remote with whatever the name of your module is.

    For build.gradle

    api project(':spotify-app-remote')
    

    For build.gradle.kts

    api(project(":spotify-app-remote"))
    
Sign up to request clarification or add additional context in comments.

17 Comments

This should be the accepted answer in 2021 and onward. This is really dumb to have to do this manually. So something tells me the developers of Android Studio aren't so stupid as to leave it this way , so probably in the next release of Android Studio, we'll all be back here trying to figure out yet another way of doing this.
Is it possible to add multiple AARs to a to a single library module by adding multiple artifacts.add clauses?
would it be possible to create example repo with this? I have an issue where gradle reports that "spotify" project cannot be found (I used my own name in my code)
Currently experiencing the following error: org.gradle.api.UnknownProjectException: Project with path ':spotify-app-remote' could not be found in project (NB: 'spotify-app-remote' is a placeholder for my library name)
I was able to build the module itself with this approach but when I add this module in an app, it complains saying : Project with path ':libs' could not be found in project
|
168

I recently encountered the same issue, the fix was to remove the library from libs/ and import it using File -> New -> New Module -> Import .JAR/.AAR Package, then referencing it in the library module build.gradle file:

dependencies {
  implementation project(":imported_aar_module")
}

If you are on a newer Android Studio version (4.0.0+), this option is not available. Instead you have to do it manually.

  1. Create a new directory and put the following content into the build.gradle file withing the new directory:
configurations.maybeCreate("default")
artifacts.add("default", file('[nameOfTheAar].aar'))
  1. Place the aar into this new directoy. Next to the build.gradle file.
  2. Add the new created Gradle project to the settings.gradle file:
include(":pathToTheCreatedDirectory")
  1. Include the project in your library where you want to use the aar:
implementation project(":pathToTheCreatedDirectory", configuration = "default")

25 Comments

With this solution we would suddendly need a few more modules. Sad that there are no more infos about this new warning, it's not really logical to me, our project works how it is.
Just a heads up comment - I was looking for a solution where one AAR can contain another AAR. That is not the case with this answer. Second AAR is created successfully but it isn't bundled with the first one.
Import .JAR/.AAR Package is not available in android studio 4.
When I do this I get Could not set unknown property 'configuration' for settings 'android' of type org.gradle.initialization.DefaultSettings., anyone else run into that? Gradle plugin 4.2.2.
implementation project(":pathToTheCreatedDirectory", configuration = "default") causes error Could not set unknown property 'configuration'... ____________________ implementation project(":pathToTheCreatedDirectory") works.
|
69

When building an Android library that depends on other Android libraries (i.e., aar files), you will get the following error message if you include the aar files as dependencies in the project:

Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error).

As the above message states, when you build an Android library project, any aar it depends on is not packaged. If you built this way prior to AGP (Android Gradle Plugin) 4, you probably noticed that you had to include the aar dependencies on the project consuming your library.

You can compile your Android library project by specifying that the aar dependencies are compileOnly. See this for more info on when to use compileOnly.

So just add the following to your app build.gradle file:

compileOnly files('libs/some-library.aar')

Note that if you do this you will have to include the aar dependencies on the application project that consumes your library.

Alternatively, you can create a module that imports your aar dependency as @Sandi mentioned in the answer above.

Another way is to publish your aar dependencies to a maven repository and then add them to your library project like this:

implementation 'mylibrarygroup:mylibraryartifact:version-x.y.z@aar'

11 Comments

Not sure how this answer ever helped anyone. Google states: "You can't use the compileOnly configuration with AAR dependencies." in their docs: developer.android.com/studio/build/dependencies
@DarkNeuron that's because the OP's use case is different: you have a library project that compiles to an aar which also depends on other aars. So for this case, compileOnly works with the caveats noted in my answer (i.e., you have to include the aar dependencies that are compile only in the project consuming the library)
What? No no, my use case was exactly the same: Was building a library that used an AAR. I posted the above because it did NOT work. Everything compiled, but the library was missing from the final bundle. Which left me confused until I saw that note by Google. In any case I solved my aar problem by extracting the jar file contained within. Which might not work for everyone.
@Żabojad then you didn't understand the above answer. You have to include the dependencies.
How to include the aar dependencies on the application project that consumes your library ? how to publish your aar dependencies to a maven repository ? @Luis
|
16

In my experience, when Gradle Plugin version is 4.2.2+ and Gradle version is 7.1+, as in @Luis's answer 'compileOnly' works.

compileOnly files('libs/your_library_name.aar')

It didn't work when the Gradle versions were lower.

4 Comments

With this it compiles but later on in the app it crash when I try to call this lib
@murt Do you have log of the crash?
Yes it compiles indeed, but the aar is then not loaded at runtime and the app crashes.
Yes, this is only half the answer. @Luis answer add the important addition; "Note that if you do this you will have to include the aar dependencies on the application project that consumes your library." See Simon answer for how to do that.
16

Rather than creating a new module for the .aar. A much simpler approach is to have the app module add the .aar file as a dependency. The library module could just have a compileOnly dependency on the .aar file.

I usually set it up in the following way,

In the root directory, I have a folder global-libs. Copy the .aar library file here.

app-module -

implementation(files("../global-libs/some-lib.aar"))

library-module -

compileOnly(files("../global-libs/some-lib.aar"))

This way the .aar is bundled in the final apk, and the build also succeeds without any warning.

4 Comments

Great solution. Thanks. I had to do it this way right after replacing a flatDir declaration by a sourceSet jniLibs.srcDir otherwise it would not compile a release build.
This is not a good solution because it will unnecessarily expose app-module to some-lib.aar even if app-module does not have any dependency on some-lib.aar. library-module is the module that has a dependency on some-lib.aar, so the answer provided by @Jarrod Robins is the correct one.
But according to android offical doc: Note: You can't use the compileOnly configuration with Android Archive (AAR) dependencies. from developer.android.com/build/…
This solution is brittle; it could cause your app to crash at runtime if the implementation is removed or forgotten. However, the other solutions didn't work for me, so thanks for this work-around!
11

I faced a similar problem:

Task: add .aar SDK inside another SDK

Solution:

  1. We have to create new Android Library Module inside our library (right click on our library name -> module -> Android library )

  2. Delete all files inside it

  3. Insert our .arr inside this module

  4. Create build.gradle file inside module and put there:

    configurations.maybeCreate("default")
    artifacts.add("default", file('your_arr_name.aar'))
    
  5. Add to your library build.gradle inside dependencies block next:

    implementation project(':your_library:your_arr_module')
    
  6. Now rebuild project and everything should work fine

5 Comments

It's the only answer that worked for me. Additionally, I had to manually move the created module folder inside my library's folder. I also noticed that root-level settings.gradle was appended with include ':your_library:your_arr_module', which is important to include if you're linking a React Native library. [I had an issue with react-native-spotify-remote library which failed on the release Gradle build, so I had to fork it & apply this fix]
I follow this step, and solve my problem.but face a new problem that I can't get style, string, drawable and other resources in my java code like R.style.xxx R.string.xxx
Actually worked fine! should be the best answer
This gives an error during dependency analysis.
@Daniel which folder exactly did you put your lib module? We are developing an expo module and have the same problem. When we try to create a relase on Gtlab CI we are getting this error.
11

Getting same error when use this code.

implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation fileTree(include: ['*.aar'], dir: 'libs')

Replace your code with following.

Open the top level ‘build.gradle’ file and add.

repositories {
    flatDir {
        dirs('/src/main/libs')
    }
}

Then in your project’s build.gradle add the following.

api(name:'aar_module_name', ext:'aar')

Comments

9

There are some changes now, You need to add your AAR or JAR as a dependency

1.) First, Navigate to File > Project Structure [Reference Image 1]1

2.) Then go to Dependencies > Declared Dependencies tab, click and select JAR/AAR Dependency in the dropdown [Reference Image 2]2

3.)In the Add Jar/Aar Dependency dialog, first enter the path to your .aar or .jar file, then select the configuration to which the dependency applies. If the library should be available to all configurations, select the "implementation" configuration. [Reference Image 3]3

4.) Click OK then Apply > OK.

You are good to go.

3 Comments

It works! But the file structure is different from the Sandi's answer.
I tried this for a library module and it did not work. This is what the OP is about. I am quite sure this approach works perfectly for an app module.
I did this, and it worked until I renamed the project directory. Tried to redo it, not working.
9

I had the same issue, in the sense I wanted to encapsulate a library dependency into a module. However this library dependency had a bunch of aars and creating separate module each of them is just clutter, and can't even find that option in the new studio.

To resolve it I published the aar-s into my local maven, before starting the build process.

So my encapsulating module's build.gradle looked like this:

plugins {
  id 'com.android.library'
  id 'kotlin-android'
  id 'maven-publish'
}
//..
parent.allprojects { // for some reason simply repositories didn't work
  repositories {
    mavenLocal() 
  }
}
//...
publishing {
  publications {
    barOne(MavenPublication) {
        groupId 'foo-aar-dependency'
        artifactId 'bar1'
        version '1.0'
        artifact("$libsDirName/bar1.aar")
    }
    barTwo(MavenPublication) {
        groupId 'foo-aar-dependency'
        artifactId 'bar2'
        version '1.0'
        artifact("$libsDirName/bar2.aar")
    }
    barThree(MavenPublication) {
        groupId 'foo-aar-dependency'
        artifactId 'bar3'
        version '1.0'
        artifact("$libsDirName/bar3.aar")
    }
    // and so on...
  }
}

// add the publication before the build even starts
// used ./gradlew mymodule:assemble --dry-run to find where to put it
afterEvaluate {
  tasks.clean.dependsOn("publishToMavenLocal")
  tasks.preBuild.dependsOn("publishToMavenLocal")
}

dependencies {
  implementation "foo-aar-dependency:bar1:1.0"
  implementation "foo-aar-dependency:bar2:1.0"
  implementation "foo-aar-dependency:bar3:1.0"
  // and so on
  // also I had to make sure to add the aar's transitive dependencies as implementation below
}

Note: When I sync for the first time the dependencies are not found, but as soon as any clean/assemble is called the dependencies are published prior so it runs as it needs.

Note2: most of this can be moved into a separate file to not clutter your build.gradle

Note3: If you actually want to publish your module as a library this solution is not for you.

Note4: This also works on CI if you run clean then your next task.

6 Comments

this is the true answer! Maven is recommended over unsupported AAR dependencies, and I have been looking for a way to use my local AARs/artifacts from mavenLocal. Bravo and thank you @Gergely Hegedus!
This solution work perfectly, covering encapsulation if you're planning to publish library. You saved my week !!
@SonTieu did you publish your library to mavenCentral with local AAR dependencies? Does this solution work for mavenCentral or only mavenLocal?
@KuvonchbekYakubov i tried to use my own aar, so this solution worked in my case with mavenLocal. I haven't tried to publish to mavenCentral though.
@Gergely Hegedus If my aar have dependencies, how would you declare it in this case ? i want something like specifying where my aar's pom is, along with my aar artifact.
|
6

Patch the problematic 3rd party dependency's build.gradle file. Under their dependencies { } section, they had a line like this:

implementation fileTree(dir: 'libs', include: ['*.jar','*.aar']) //Load all aars and jars from libs folder

My patch changes that line to:

implementation(name: 'the-name-of-the-aar', ext: 'aar')

In my project's build.gradle, under allprojects { repositories { }, added:

flatDir { dirs "$rootDir/../node_modules/the-third-party-dependency/android/src/main/libs" } 

Where the AAR file lives

It was tested with reactnative >= 0.69.x

2 Comments

really saved my life
I am getting warning that using flatDir should be avoided
5

For those who prefer to use as a regular dependency (or an item on your Gradle's version catalog):

  1. Create a folder eg. spotifyAppRemote at the same level of app folder
  2. Add the desired .aar file at the root of spotifyAppRemote folder
  3. Create a settings.gradle.kts file at the root of spotifyAppRemote folder. This file will be empty, it just needs to be there for the composite builds. See: docs
  4. Create a build.gradle.kts file at the root of spotifyAppRemote folder:
plugins {
    base //allows IDE clean to trigger clean on this module too
}

configurations.maybeCreate("default")
artifacts.add("default", file("spotify-app-remote-release-0.7.2.aar"))

//Change group to whatever you want. Here I'm using the package from the aar that I'm importing from
group = "com.spotify.android"
version = "0.7.2"
  1. Next add Gradle files to this folder to allow this module to build itself. You can do it manually or add the following snippet at the root of settings.gradle.kts (!! the project root, not the empty one created above)
/* Optional - automatically sync gradle files for included build */
rootDir.run {
    listOf(
        "gradle.properties",
        "gradlew.bat",
        "gradlew",
        "gradle/wrapper/gradle-wrapper.jar",
        "gradle/wrapper/gradle-wrapper.properties"
    ).map { path ->
        resolve(path)
            .copyTo(
                target = rootDir.resolve("spotifyAppRemote").resolve(path),
                overwrite = true
            )
    }
}
  1. Now you can go ahead and add this folder as a module at the settings.gradle.kts on your project root. The same where may add the snippet above:
rootProject.name = "Your project name"
include(":app")
includeBuild("spotifyAppRemote")
  1. Sync and build your project.
  2. Now your included build will be available for your as a regular dependency with the defined group and version. To use this dependency:
dependencies {
    // group:moduleName:version
    implementation("com.spotify.android:spotifyAppRemote:0.7.2")
} 

Thanks other members for the solution.

Source code on github: https://github.com/rsicarelli/SpotifySdkCompositeBuild

7 Comments

Please provide the solution for groovy (settings.gradle)
This solution works properly (the library builds and the module classes are available) but if I export the library as .aar into another Android project, the module code is missing. Inspecting the library .aar file, it does not embed the dependency module.
@matmacci were you able to fix it? i have same problem
@Lukᚊálek I've opened a new question, but noone has given any answer yet. It's incredible that Google does not provide any clear information about that.
You literally saved my day! Very precise, detailed explanation on your Github page. Thank you !
|
2

If you want to bundle a local .aar within your library and use that library in another project, you could take a look at "fat aars" https://github.com/kezong/fat-aar-android

1 Comment

Be warned: The FAT AAR somehow works. But it is NOT mature enough. It only supports some AGP features. Notably, it does not support multi-flavour builds. Also, it is a community effort, so it is always behind the head (support for new AGPs is coming easily 1 year later). It is a real shame that Google is too lazy to add and maintain the FAT AAR feature themselves. They already have all the required functionality (they are able to merge any number of AARs when producing the APK).
2

My use case was for creating a Flutter Plugin but the solution was still the same as Link182's. I did find an implementation that I used as an example on Github

However, I had to use explicit version (X.X.X) rather than + to get it to work after creating maven directories, .pom, and manifest files: api(group: 'com.example.group', name:'exampleArtifact', version: '1.0.0')

Comments

2

If there are errors with connecting an AAR library to your project and none of the iterated possibilities were working, try to extract a JAR file from the AAR archive.

  1. Rename the name-of-your-library.aar to name-of-your-library.zip
  2. Extract the archive
  3. Find a 'jar' file in the extracted archive folder, it could be 'classes.jar' file
  4. Rename as you wish and insert to your project:
  • Add your 'jar' lib file to the 'libs' folder (create it in the root of your project, if the folder is missing). Structure should be like: libs/name-of-your-library.jar
  • Add to your dependencies implementation files('libs/name-of-your-library.jar')

Done.

Comments

1

EDIT : if the AAR does not contain android resources or native code, this could help you.

If you want this local resource directly linked to an "app" or "sdk" module (no compileOnly)

=> Use a jar.

  • Rename the .aar to .zip
  • Extract it
  • Use the classes.jar inside

That's it.

2 Comments

jars are not equivalent to an aar, they can't contain native code or other android resources.
Of course. But when this is not the case this trick could be useful.
1

Adapt aar dependency to maven repo standards and depend on it.

Lets connect the dependency in build.gradle

repositories {
    maven { url "$project.projectDir/libs" }
}

dependencies {
    api "my-library-group:my-library-module:my-library-version"
}

Replace you libs/myLibrary.arr file with next files:

libs/my-library-group/my-library-module/my-library-version/my-library-module-my-library-version.aar
libs/my-library-group/my-library-module/my-library-version/my-library-module-my-library-version.pom
libs/my-library-group/my-library-module/maven-metadata-local.xml

Where my-library-module-my-library-version.aar is the original aar file

Content of my-library-module-my-library-version.pom

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>my-library-group</groupId>
  <artifactId>my-library-module</artifactId>
  <version>my-library-version</version>
  <packaging>aar</packaging>
</project>

Content of maven-metadata-local.xml

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>my-library-group</groupId>
  <artifactId>my-library-module</artifactId>
  <versioning>
    <latest>my-library-version</latest>
    <release>my-library-version</release>
    <versions>
      <version>my-library-version</version>
    </versions>
    <lastUpdated>20211130111015</lastUpdated>
  </versioning>
</metadata>

Feel free to replace my-library-group, my-library-module, my-library-version with any value you like

1 Comment

I have tried but getting error. Can u please post your full build.gradle files or post the github link for convenience. @Link182
0

It is bug in Android Studio 4.0.+.However, there is a solution.

First, project/build.gradle:

allprojects {
   repositories {
        google()
        jcenter()
        mavenCentral()
        flatDir {dirs "../MoudleA/aars,../MoudleB/aars,../MoudleC/libs".split(",")
        }
    }
}

Second, Moudle/build.gradle:

// MoudleA/build.gradle

repositories {
    flatDir {
        dirs 'aars'
    }
}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    //api fileTree(dir: 'aars', include: ['*.aar'])
    // aar
    new File('MoudleA/aars').traverse(
            nameFilter: ~/.*\.aar/
    ) { file ->
        def name = file.getName().replace('.aar', '')
        api(name: name, ext: 'aar')
    }
}

// MoudleB/build.gradle

repositories {
    flatDir {
        dirs 'aars'
    }
}

dependencies {
    api fileTree(dir: 'libs', include: ['*.jar'])
    //fullApi fileTree(dir: 'aars/full', include: ['*.aar'])
    //liteApi fileTree(dir: 'aars/lite', include: ['*.aar'])
    // aar
    new File('MoudleB/aars/full').traverse(
            nameFilter: ~/.*\.aar/
    ) { file ->
        def name = file.getName().replace('.aar', '')
        fullApi(name: 'full/' + name, ext: 'aar')
    }
    new File('MoudleB/aars/lite').traverse(
            nameFilter: ~/.*\.aar/
    ) { file ->
        def name = file.getName().replace('.aar', '')
        liteApi(name: 'lite/' + name, ext: 'aar')
    }

}

// MoudleC/build.gradle

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    //api fileTree(dir: 'libs', include: ['*.jar','*.aar'])
    api fileTree(dir: 'libs', include: ['*.jar'])
    // aar
    new File('MoudleC/libs').traverse(
            nameFilter: ~/.*\.aar/
    ) { file ->
        def name = file.getName().replace('.aar', '')
        api(name: name, ext: 'aar')
    }
}

It works for me,You can also try.

Comments

0

You can upload the AARs to an Artifactory, and consume them.

Comments

0

In my case, I realised that I have created libs folder at wrong place then recreated folder in main folder and implementation fileTree(include: ['*.aar'], dir: 'libs') worked.

Comments

0

Good news for everyone. It seems that we can finally include AARs without subprojects again. I was able to accomplish it using the implementation files directive as follows in the dependencies { } block:

implementation files('ssi.aar')

4 Comments

I already have this directive in my project but I still have this problem.
where did you include the ssi.aar file? in libs folder?
@MoustafaEL-Saghier you can put the file anywhere. it doesn't have to be the libs folder.
When I don't use libs/ before ssi.aar, it doesn't find the aar: Null extracted folder for artifact: ResolvedArtifact(componentIdentifier=ssi.aar, variant=local file, variantName=null, artifactFile=.../moduleName/ssi.aar, isTestFixturesArtifact=false, extractedFolder=null, publishedLintJar=null, dependencyType=ANDROID, isWrappedModule=false, buildMapping={__current_build__=/projectName}). And when I use, I still get the same error as the question
0

In kotlin multiplatform projects put the AAR under shared/libs/ folder.

After that use this in androidApp build.gradle.kts (in dependencies):

implementation(files("../shared/libs/example.aar"))

And this in build.gradle.kts of shared module (where is val androidMain by getting{...}):

compileOnly(files("libs/example.aar"))

Comments

-1

I also hit this issue when I increase my Android plugin version to 4.0.1, and it turns to error, tried some solutions but none of them are actually doable in our project.
Since we are using product flavours, and different flavours are using different local aar file, we simply can not just using api(name: "xxx", ext: 'aar') since those aar files are located in different flatDir.
For now I have to roll back to previous gradle plugin version.
will edit this answer if I figure something out

Comments

-2

Much lazier way to do this in build.gradle.kts files is to use a fileTree combined with flatDir repository.

repositories {
  flatDir {
    dir("$rootDir/libraries")
  }
}

dependencies {
   fileTree("$rootDir/libraries").forEach { file ->
        implementation(group = "", name = file.name.removeSuffix(".aar"), ext = "aar")
    }
}

This way when you add or remove deps to the folder they are automatically configured

Comments

-4

for me works this solution: put into dependences in build.gradle:app file this string:

api fileTree(dir: 'libs', include: ['*.aar'])

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.