在使用Gradle高版本依赖本地aar打包时,我们发现会遇到一个报错,故在下面提供了具体的报错信息和解决方案,可以参考。
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_core project caused this error: X:\xxxxxxxx\library_core\libs\effectAAR-release.aar
解决方案:将library_core模块本地直接依赖aar的方式修改为本地仓依赖的方式
具体分为下面3步:
configurations.maybeCreate("default") artifacts { add("default", file("effectAAR-release.aar")) }