ubu
05/26/2021, 10:44 AM.aar
library, which is located on the project level: libs/lib.aar
. I declare it in an Android Library module in the following manner:
implementation files('libs/lib.aar')
After updating to the latest Android Gradle Plugin:
-classpath 'com.android.tools.build:gradle:3.5.3'
+classpath 'com.android.tools.build:gradle:7.0.0-beta02'
I got this error message:
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 only thing I could find on Stackoverflow was the following:
https://stackoverflow.com/questions/60878599/error-building-android-library-direct-local-aar-file-dependencies-are-not-supp
But these solutions seem outdated.
Following official documentation here didn’t help either.
Did someone encounter this issue? Need help! 🆘plastiv
05/26/2021, 10:49 AMplastiv
05/26/2021, 10:50 AMubu
05/26/2021, 10:56 AMplastiv
05/26/2021, 10:59 AMsubprojects {
repositories {
maven {
url "${rootProject.projectDir}/libs"
metadataSources {
artifact()
}
content {
includeModule("com.snowplowanalytics", "jetified-snowplow-android-tracker")
}
}
}
}
ubu
05/26/2021, 11:00 AMplastiv
05/26/2021, 11:00 AMplastiv
05/26/2021, 11:01 AMubu
05/26/2021, 11:06 AMno
05/26/2021, 3:35 PM.aar
files with library resource. This is why the functionality was removedplastiv
05/26/2021, 3:37 PMplastiv
05/26/2021, 3:40 PMubu
05/26/2021, 5:07 PMno
05/26/2021, 5:10 PMubu
05/26/2021, 6:01 PMno
05/26/2021, 7:01 PMubu
05/26/2021, 7:41 PMno
05/26/2021, 7:45 PMubu
05/27/2021, 9:21 AMEl Zhang
05/27/2021, 9:37 AMBut these solutions seem outdated.Well, the stackoverflow answer was operated by IDE, though the menu is gone, but you can make it work with Gradle directly: Create a
build.gradle.kts
with following code, and put your .aar
file along with it to create an aar module
configurations.maybeCreate("default")
artifacts.add("default", file("filename.aar"))
ubu
05/27/2021, 9:54 AMEl Zhang
05/27/2021, 9:57 AMno
05/27/2021, 3:10 PMubu
05/27/2021, 3:54 PMno
05/27/2021, 4:40 PM