首页 > 解决方案 > 任务“:app:countPlayUatDexMethods”执行失败

问题描述

在启用 Instant Run 的 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)

版本详情:

标签: android-studioandroid-gradle-pluginbuild.gradlegradle-pluginandroid-instant-run

解决方案


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

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

感谢链接中的解决方案。


推荐阅读