当前位置:网站首页>解决:Direct local .aar file dependencies are not supported when building an AAR.
解决:Direct local .aar file dependencies are not supported when building an AAR.
2022-07-28 21:54:00 【锐湃】
ndroid Studio 4.0+版本在打包过程中抛出以下异常
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 :XXXXXXXXXX
解决方案如下:
1.新建一个module,主要保留build.gradle文件(其他文件可以删掉)
2.将“The following direct local .aar file dependencies of the :”后提示的aar文件放到新建的module的根目录中,module目录结构如下:
3.修改build.gradle文件内容,如下:
configurations.maybeCreate("default")
artifacts.add("default", file('xxxx.aar'))
// 如有多个aar,只需要再次add
//artifacts.add("default", file('xxxx2.aar'))
//......
//artifacts.add("default", file('xxxxn.aar'))
4.将原aar的module去以module的形式依赖新module,依赖形式为 compileOnly,如下:
dependencies {
...
compileOnly project(path: ':newmodule')
...
}
5.再次打包即可
————————————————
版权声明:本文为CSDN博主「sayhello_class」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/sayhello_class/article/details/123047897
边栏推荐
- 如何开一家盈利的健身房?我用1年回本的经验告诉你,别谈恋爱
- Codeforces Round #810 (Div. 2) A - C
- 2022 welder (Junior) work license questions and answers
- 【自】-刷题-逻辑
- Runloop principle (I)
- 经典双栈实现队列,注意遍历栈的判定条件修改。
- 阻塞式队列
- Plato Farm有望通过Elephant Swap,进一步向外拓展生态
- In order for digital retail to continue to play its role, we need to give new connotation and significance to digital retail
- 英特尔数据中心GPU正式发货,以开放灵活提供强劲算力
猜你喜欢
【CNN】为什么CNN的卷积核大小一般都是奇数
Codeforces Round #810 (Div. 2) A - C
2022年R2移动式压力容器充装考题模拟考试平台操作
[self] - brush questions BFS
编译原理研究性学习专题 2——递归下降语法分析设计原理与实现
如何开一家盈利的健身房?我用1年回本的经验告诉你,别谈恋爱
【自】-刷题-集合
超参数优化(网格搜索和贝叶斯优化)
Intel data center GPU is officially shipped to provide strong computing power with openness and flexibility
Development of small programs ②
随机推荐
Inspur clusterenginev4.0 remote command execution vulnerability cve-2020-21224
Mycms we media mall V3.6 release, compatible with micro engine application development (laravel framework)
金仓数据库KingbaseES 客户端编程接口指南 - ODBC特性支持约束
经典的拓扑排序问题——LeetCode207 课程表+LeetCode210 课程表II
Fundamental inquiry binary tree
2022焊工(初级)上岗证题目及答案
22 Niuke multi school Day1 I - Introduction to chiitoitsu DP
xss.haozi.me靶场详解
【自】-刷题-集合
二舅火了,全网刷屏,他凭什么能治好我的精神内耗?
The computer doesn't know what to uninstall, can't open the calculator, can't edit screenshots, can't open txt files, and so on
What's special about this wireless router, which is popular in the whole network?
Trivy [3] custom scanning strategy
Class, leetcode919 -- complete binary tree inserter
LabVIEW对VISA Write和Read函数的异步和同步
2022 welder (Junior) work license questions and answers
网络流量监控工具iftop
利用递归和链表头插法实现链表成组的翻转——LeetCode25 K个一组翻转链表
从XSS Payload学习浏览器解码
Merkle tree