起因是遇到了使用aar时的这个问题:Direct local .aar file dependencies are not supported when building an AAR
找到一篇大佬的解决方案直接上链接:
完美解决Direct local .aar file dependencies are not supported when building an AAR. - 拜雨 - 博客园
很完美,但是当我在自己的项目按照 new module import .arr package导入aar时,它直接变成了Android library ,因为他是一个Android library所以编译的时候一直提示
Manifest file does not exist:
感觉应该是gradle的配置出了问题,后来经过查找发现了在整个项目的根目录的build.gradle中有这么一段
subprojects {
if (name == "app") {
apply plugin: 'com.android.application'
} else {
apply plugin: 'com.android.library'
}
}
就是它导致了我本来只想引入个.arr的依赖包但是莫名的变成了Android的library
解决办法:
可以把它注释掉
或者修改逻辑在else中判断如果是我们导入的.arr的包就不执行
apply plugin: 'com.android.library'这一句