admin管理员组

文章数量:1590159

错误日志如下:


> 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 :libenhance project caused this error:

 


解决方案:

第一步:

在app的目录下增加libs,把aar的依赖包复制一份放到里面去。

在对应gradle文件中配置   implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')

 

第二步:

在真正使用aar包的moudle的gradle文件中配置

implementation fileTree(include: ['*.jar'], dir: 'libs')

compileOnly fileTree(include: ['*.aar'], dir: 'libs')

 :项目中使用的gradle版本是

distributionUrl=https\://services.gradle/distributions/gradle-6.7-all.zip

本文标签: 加载文件Localaar