implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(files("BudgetLibraryNBB.aar"))
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(files("BudgetLibraryNBB.aar"))
The recommond method is import it using File
-> New
-> New Module
-> Import .JAR/.AAR Package
, then referencing it in the library module build.gradle.kts
file:
implementation(project(":BudgetLibraryNBB"))
If you put it into libs dir:
implementation(files("./libs/BudgetLibraryNBB.aar"))
or
implementation(files("$projectDir/libs/BudgetLibraryNBB.aar"))
when you are executing bundleAar task, you will meet error below:
Execution failed for task ':common: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 :common project caused this error:
This is really simple, just include
*.aar
infileTree
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
PS. of course if you still keep your library in
libs
dir