6

When I updated to Android Studio 3.1, Instant Run features (hot swap, warm swap) stopped working.
Every time when I click on Apply Changes (Instant Run Flash option), Android Studio is restarting my app (even for small UI changes) for every OS above lollipop. (On physical device as well as emulator)

My Instant Run Setting -

enter image description here

Message that I get from Android Studio - enter image description here

I tried -

  1. Restarting laptop after Android Studio update.
  2. Invalidating cache and restart
  3. Closing the project and import it again

Nothing worked for me. Please help me with this and kindly let me know any more information is needed from my side.

UPDATE:-

My Top level Gradle code -

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        mavenCentral()
        maven { url 'https://maven.google.com' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

In my File > Project Structure > Project menu, it is showing my Gradle Version as 4.4 and Android Plugin Version as 3.1.0.

Varad Mondkar
  • 1,441
  • 1
  • 18
  • 29

1 Answers1

-1

If you are using old version version of gradle. Please upgrade to 4.x

dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }

Update the version and then try.

Däñish Shärmà
  • 2,891
  • 2
  • 25
  • 43