Android 必知必会 - Android Studio 2.3 找回 exploded-aar 目录【官方已更新】

今天收到邮件提示 exploded-aar 目录问题在 gradle plugin 2.5 版本修复好了。

Marked as Fixed

in 2.3/2.4 you can look in the build cache entries and look in the input file that indicate the source of the cache entry (maven coordinate).
in 2.5+ we switched to Gradle’s own cache so you’ll have to look in the gradle folder.
If all you need is manually get the aar content you could also manually download the aar and unzip it yourself.

查看 Issue 详情(需要梯子):Issue 页

— 更新于 2017-05-11


升级到 Android Studio 2.3 后,Gradle Plugin 也升级到 2.3.0,对应推荐使用的 Gradle 版本是 3.3。

这时候会发现项目目录下 {module name}/build/intermediates/exploded-aar/ 目录没了,经过一番查找,发现这并不是一个 Bug,是官方刻意为之,它会在 {user name}/.android/build-cache 下生成一部分缓存文件,来代替 exploded-aar ,如果需要生成它,可以配置项目目录下的 gradle.properties ,添加一行内容:

1
android.enableBuildCache=false

然后重建项目即可在 {module name}/build/intermediates/ 看到 exploded-aar 目录了。

想重新开启 BuildCache 功能,可以修改为 android.enableBuildCache=true 或者直接删除本行内容即可。

PS:你可以通过下面的方式和我联系