添加构建依赖项报错

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).

添加构建依赖项: https://developer.android.google.cn/studio/build/dependencies#remote-repositories

添加百度地图的AAR时,直接运行没报错,但 ReBuild 时报错,

implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar"))))

可以尝试在 map module 中使用 compileOnly,而在 app module 下使用 implementation解决报错。

参考

https://blog.csdn.net/yeshennet/article/details/114331818

你可能感兴趣的:(添加构建依赖项报错)