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 :library_module project caused this error: 
______.aar

解决方案如下:

新建Module

 新建完后把里面所有的文件除了自带的Gradle删除

然后下一步把Gradle里面的内容清空

 

 把需要用到的aar放进来

 下面就是Gardle里面的写法

 

configurations.maybeCreate("default")
artifacts.add("default",file("YouLibs"))

最后引入

 引入可以用imp也可以用api

引入的是你新建的module

不要忘记再setting.gradle里面includ新建的module

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐