Android studio 3.1 run command does not rebuild the APK [duplicate]
Asked Answered
L

2

18

This is very annoying aspect of the new android studio version 3.1, I used to launch run command after every code changes, the IDE rebuilds the (whole project & APK) and then deploys it on the target device.

Then after upgrading to version 3.1, the run command does not rebuild the apk any more, and displays the following error messages.

android studio 3.1 Session 'app': Error Installing APK

android studio 3.1 The APK file Error while Installing APK

so I have click on" rebuild & run" each time I make code modification, how can I restore the old behavior of version 3.0.1

Lawler answered 27/3, 2018 at 8:37 Comment(2)
Sounds like there might be a read/write permission issue. Have you tried restarted the IDE or even your entire OS?Deal
Fix in android studio 3.1.1 Check my answer https://mcmap.net/q/103651/-android-studio-3-1-quot-run-quot-not-compiling-code for details.Tarsometatarsus
T
48

Go to Run -> Edit configurations. And then make sure you have Gradle-aware Make option like below screenshot.

enter image description here

If not then click + and select from the

More update in twitter regarding this:https://twitter.com/androidstudio/status/981914632892960768

Tarsometatarsus answered 27/3, 2018 at 8:47 Comment(9)
thank you, it solved the issue !!Lawler
Had same issue. Thanks god for this answer :DForce
Thanks, this worked for me as well!Greenlee
@MarcosDaSilva This is not issue this is feature! lolFrighten
NOT WORKING: Shutdown finished in 0ms Error while generating dependencies split APK com.android.ide.common.process.ProcessException: Failed to execute aapt at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:809) at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:797) at com.android.build.gradle.internal.transforms.InstantRunSplitApkBuilder.generateSplitApkResourcesAp(InstantRunSplitApkBuilder.java:373)Rosenkranz
Disable instant run and then try again.Tarsometatarsus
disabling instant run is not an answer, we all need it )))Rosenkranz
@Rosenkranz Check this answer also https://mcmap.net/q/103964/-using-instant-run-results-in-quot-session-app-error-while-installing-apks-quotTarsometatarsus
For me, I removed "Instance App Provision" from Run -> Edit Configurations. Then it worked.Baggy
R
-1

disable the instant run option. Open Settings from File > Settings Navigate to Build,Execution,Deployment > Instant Run Uncheck the enable instant run check box

Rust answered 27/3, 2018 at 8:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.