Jitpack发布Android库出现Direct local .aar file dependencies are not supported when building an AAR
本文为作者原创,允许转载,不过请在文章开头明显处注明链接和出处!!! 谢谢配合~
作者:stars-one
链接:https://www.cnblogs.com/stars-one/p/16933403.html
本篇大约有1394个字,阅读预计需要1.74分钟
问题描述
由于我项目中某个Module引用了本地的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 :ocr project caused this error: /home/jitpack/build/ocr/libs/ocrsdk.aar
解决方法
把引用的implementation
改为provided
即可,如下图所示
网上找到了大都是是要去改setting.gradle,实际上改了还发现出现了其他错误。。。
如果想要验证是否还有错误,可以通过Gradle右侧的菜单来触发发布aar的操作
实际上,我测试的发布aar,还是出现了报错,不过是资源文件里的某个颜色定义找不到,但用Jitpack上打包则正常,就没有过于深究原因了
参考
- 完美解决Direct local .aar file dependencies are not supported when building an AAR. - 拜雨 - 博客园
- Direct local .aar file dependencies are not supported when building an AAR._芝麻棍儿的博客-CSDN博客
- 解决:Direct local .aar file dependencies are not supported when building an AAR._yuanzhihui123的博客-CSDN博客_direct local .aar file dependencies are not suppor
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术