Can't run app with Instant Run on Android Studio 3.0

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 04:17:34

问题


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

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/

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

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


回答1:


Have your settings as below,

Otherwise try to clean and re-install (after uninstalling exsisting apk) application.




回答2:


I found the problem and the solution.

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.

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




回答3:


Configure your project for Instant Run

Android Studio enables Instant Run by default for projects built using Android plugin for Gradle 2.3.0 and higher. Please checkout this LINK to configure your project for instant run.



来源:https://stackoverflow.com/questions/47273923/cant-run-app-with-instant-run-on-android-studio-3-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!