任务 ':app:countPlayUatDexMethods' 执行失败

Execution failed for task ':app:countPlayUatDexMethods'

我在启用 Instant 运行 的 Android Studio 3.1.3 中构建应用程序时遇到以下错误。

Execution failed for task ':app:countPlayUatDexMethods'.
> java.io.FileNotFoundException: C:\Users\Rakesh\Desktop\appWorkspace\app\build\intermediates\instant-run-resources\resources-play\UAT-PLAY.apk (The system cannot find the file specified)

日志显示:

:app:countPlayUatDexMethods FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:countPlayUatDexMethods'.
    > java.io.FileNotFoundException: C:\Users\Rakesh\Desktop\appWorkspace\app\build\intermediates\instant-run-resources\resources-play\UAT-PLAY.apk (The system cannot find the file specified)

版本详情:

我找到了原因和解决方案。 dexcount-gradle-plugin 是麻烦制造者。我将其版本更新为:

classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.3'

感谢 link 中的解决方案。