Direct local •aar file dependencies are not supported when building an AAR.
The resulting AAR would be broken 2 because the classes and Android resources from any local .aar
file dependencies would not be packaged in the 2 resulting AAR. Previous versions of the Android
Gradle Plugin produce broken AARs in this case too (despite not throwing this error).
我尝试将本地.aar添加到android项目下的libs目录中。 为了获取本地 aar,我在 build.gradle.kts(应用程序级别)下添加了以下实现。
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
调试模式一切正常。应用程序的发布版本存在问题。这发生在最新的 android studio 上。
发布此答案以供将来参考。
configurations.maybeCreate("default")
artifacts.add("default",file("sample_logger_1.0.0.aar"))
include(":my-local-sdk")
implementation(project(":my-local-sdk"))