添加构建依赖项报错

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容