无法在Android Studio 3.0上使用Instant Run运行应用程序

无法在Android Studio 3.0上使用Instant Run运行应用程序

问题描述:

我已更新到Android Studio 3.0,现在我无法在启用即时运行的情况下运行该应用.

I've updated to Android Studio 3.0 and now I cannot run the app with Instant Run enabled.

由于java.io.FileNotFoundException,我得到任务执行失败",因为它找不到

I get 'Execution failed for task' due to a java.io.FileNotFoundException because it can't find the apk under

../build/intermediates/instant-run-resources/resources-production/

../build/intermediates/instant-run-resources/resources-production/

有什么想法可以克服这个问题,以便我可以使用Instant Run运行项目吗?

Any idea how to overcome this so that I can run the project with Instant Run?

我不确定在哪里找到丢失的apk文件或如何更改查找路径.

I'm not sure where to find the missing apk file or how to change the path to look for it in.

我找到了问题和解决方法.

I found the problem and the solution.

在我的情况下,原因是dexcount-gradle-plugin.该插件期望打包任务产生一个APK,但在Instant Run上不再如此.因此,他们发布了一个新版本,该版本在使用Instant Run运行时会禁用该过程.

In my case the cause was dexcount-gradle-plugin. The plugin is expecting that the package task produces an APK, but that is not true anymore on Instant Run. So they released a new version that disables the process when running with Instant Run.

所以我只需要将dexcount更新到最新版本.

So I just had to update dexcount to the latest version.