admin管理员组文章数量:1590134
错误日志如下:
> 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:
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
版权声明:本文标题:打包local .aar文件加载编译问题 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1728084332a1144808.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论