当前位置:   article > 正文

Error building Android library: Direct local .aar file dependencies are not supported 亲测有效_android configurations.maybecreate("default")

android configurations.maybecreate("default")

我们在使用 Android Studio version (4.0.0+)引用aar的时候,上面的报错是不是很熟悉,修复方法是

1、把libs中的aar库删除,在项目的根目录中创建一个新目录。如下图显示spotify app remote。在其中,放入AAR,并创建一个新的build.gradle文件。

2、在本module的build.gradle文件中引用aar,如下

configurations.maybeCreate("default")
artifacts.add("default", file('spotify-app-remote-release-0.7.1.aar'))

3、在settings.gradle中声明此module

include ':spotify-app-remote'

4、在需要用到aar的地方引用 aar所在的project

api project(':spotify-app-remote')
 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/608014
推荐阅读
相关标签
  

闽ICP备14008679号