适配Android12历程(2)- 处理flatDir警告
警告:Using flatDir should be avoided because it doesn't support any meta-data formats.
一步到位,将每个aar作为module引用到其他module中。以p2p-release.aar为例:
在工程根目录新建目录LocalRepo,用来放置工程中所有的aar库,在LocalRepo中新建目录P2p_Release,将p2p-release.aar拷贝到目录P2p_Release中,在P2p_Release中新建文件build.gradle,并添加如下内容:
configurations.maybeCreate("default")
artifacts.add("default", file('p2p-release.aar'))
在工程的settings.gradle中添加
include ':LocalRepo:P2p_Release'
其他module就可以通过
api project(":LocalRepo:P2p_Release”)
来引用p2p-release.aar了。
工程的目录结构如下:


浙公网安备 33010602011771号