Android Studio 3.1 Instant Run not working
Asked Answered
O

1

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.

Owens answered 6/4, 2018 at 10:29 Comment(4)
just disable itPlaudit
@TimCastelijns Should I disable and re enable the Instant Run? or is there any issue with Instant Run so stop using it? I tried disabling and re enabling it, still the same issue.Owens
there are many issues. Just disable it and don't think about it anymorePlaudit
Hmm true even Vector assets not working :(Owens
S
-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.

Sorrows answered 6/4, 2018 at 10:32 Comment(6)
My current version after AS update is 3.1.0, Should I downgrade it to 3.0.0 or upgrade to 4.1?Owens
upgrade to 4 then try. I faced the same and this worked in my case. You can also check.Houdon
Giving me error Could not find com.android.tools.build:gradle:4.0.0Owens
Add class path dependencies as classpath 'com.android.tools.build:gradle:3.0.1Pertinacious
i am talking about gradle version not plugin version. Please refer this link: developer.android.com/studio/releases/gradle-plugin.htmlHoudon
@DäñishShärmà my Gradle Version is 4.4 and Android Plugin Version is 3.1.0. I have seen it in File > Project Structure > Project menu.Owens

© 2022 - 2024 — McMap. All rights reserved.