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:
2条答案
按热度按时间ztigrdn81#
建议的方法是使用
File
-〉New
-〉New Module
-〉Import .JAR/.AAR Package
导入它,然后在库模块build.gradle.kts
文件中引用它:如果将其放入libs目录:
或
执行bundleAar任务时,会遇到以下错误:
vsmadaxz2#
这非常简单,只需将
*.aar
包含在fileTree
中即可implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
附言。当然,如果你仍然保持你的库在
libs
目录