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

3

13

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.

Pantoja answered 13/11, 2017 at 21:33 Comment(4)
please check this answerMallorie
@AmitVaghela I have no problem with enabling/disabling. When I disable Instant Run I am able to run the project with no problem. The thing is I do want to use Instant Run, but when I enable it the apk is not found.Pantoja
yes, there are some issues with instant run. check https://mcmap.net/q/102482/-no-changes-to-deploy-android-studio-2-1Mallorie
Thanks @AmitVaghela, I don't see there anything similar to my problem, I still hope to find some solution, for instance a way to configure the apk location or something.Pantoja
P
9

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.

Pantoja answered 18/11, 2017 at 19:16 Comment(2)
This exactly was my issue. This worked for me! Thanks!Steinbach
Thanks for providing the fix. Faced the same issue and this resolved it.Sherikasherill
P
12

Have your settings as below,

enter image description here

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

Pastoral answered 14/11, 2017 at 4:30 Comment(1)
This is what I do to enable Instant Run. When I do that I have the problem I explained. Otherwise things work perfectly but without Instant run... Clean doesn't help.Pantoja
P
9

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.

Pantoja answered 18/11, 2017 at 19:16 Comment(2)
This exactly was my issue. This worked for me! Thanks!Steinbach
Thanks for providing the fix. Faced the same issue and this resolved it.Sherikasherill
E
0

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.

Estimable answered 14/11, 2017 at 4:40 Comment(1)
Thanks but this doesn't tell me anything about the location of the apk, so it doesn't solve my problem. Does it work for you? Where is your Instant Run apk located?Pantoja

© 2022 - 2024 — McMap. All rights reserved.