Android Studio 2.2.3 Instant Run is not an Option

1.2k Views Asked by At

I have a new install of Android Studio and I'm starting my first project. I was looking for ways to speed up my deploy/test development cycle when I read that I already should have the Instant Run feature enabled.

I double checked a few settings:

  • Tools->Android->Enable ADB Integration is checked

  • File->Settings->Build, Execution, Deployment->Instant Run Enable Instant Run... is checked, along with Restart activity on code changes and Show Toasts in the running app...

  • My emulator is a Nexus 5, API 24

  • The Android gradle plugin is defined as: classpath 'com.android.tools.build:gradle:2.2.3'
  • The project minSdkVersion is 16 and targetSdkVersion is 25

And yet, the Instant Run icons do not appear on my Run configurations and redeploying involves restarting the whole app and takes about a minute. Some possibilities for the error:

  • I read that DDMS must be disabled for Instant Run to work in another question. I don't know if that's true since I don't see it mentioned in the official documentation, but if I go to the Android Device Monitor I see a DDMS button that cannot be uncheked.

  • Anticipating a future integration, I enabled this project to allow for C++ code to be integrated. I'm not sure if that plays a part.

2

There are 2 best solutions below

0
On BEST ANSWER

I was stopped on two different fronts.

  1. I anticipated using a C++ library in the future for this project and created with C support setup. Use of this type of native library will prevent Instant Run from working.
  2. I wanted to take advantage of the latest Java 8 features, in this case Lambda expressions and Streams. Unfortunately this requires use of the jacktoolchain option which will prevent Instant Run from working. In general, I found these features to be buggy anyways so I opted to return Java 1.7 (insert sad-face here) and gain the benefit of being able to do rapid-deployments.

Because the new features of Java 8 are so powerful, I hope they are made available to developers sooner rather than later. One option that I have not explored is using Zero Turnaround's hot swap system with Java 8 and I will look into that.

For those that are coming here to diagnose Instant Run problems, know that checking the "Show Instant Run status notifications" in Settings -> Build, Execution, Deployment -> Instant Run might provide valuable clues as to problems with this feature (Android Studio 2.2)

1
On

Check if minSdkVersion is set to at least 15 and Android plugin for Gradle version at least to 2.0.0.

You can check all the details here

https://developer.android.com/studio/run/index.html#instant-run