1

I am trying to get Instant Run to work in Android Studio. I have A.S. 2.0 Preview 4 installed, and my Instant Run is enabled like this: enter image description here

Now, I am experimenting with this in the Topeka sample app from Google (https://github.com/googlesamples/android-topeka). So, I am placing a bunch of Toasts in CategorySelectionActivity and CategorySelectionFragment, hoping that they can be instantaneously changed with Instant Run. But every time I hit the Instant Run button in A.S., it completely shuts down the app and re-installs it. It does not resume from the same activity I was on previously (as expected), NOR is it displaying the toast message like

Applied code changes without Activity restart

Does anyone know how to get Instant Run to work properly?

Thanks, Igor

IgorGanapolsky
  • 26,189
  • 23
  • 116
  • 147

2 Answers2

1

Please update Android Studio to Android Studio 2.0 Preview 8.Android Studio 2.0 Preview 8 to the canary channel, as well as a new version of the Gradle plugin: 2.0.0-alpha8. You'll want to update both; instant run in particular is only enabled when using the latest versions of both:

Dhaval Jivani
  • 9,467
  • 2
  • 48
  • 42
0

The solution to this problem is to update Android Studio to 2.0 Preview 8, gradle wrapper to:

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

and to use this gradle dependency:

classpath 'com.android.tools.build:gradle:2.0.0-alpha8'

Instant run works now on my Mac!

IgorGanapolsky
  • 26,189
  • 23
  • 116
  • 147