Search code examples
androidandroid-studioandroid-instant-run

Instant run doesn't work anymore for my phone


I have 4.4.4 (19) Android and I can't use instant run with new version (2.3) of Android Studio:

enter image description here

enter image description here

Why did they do it? It worked on the version before this one.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'

...

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId ***
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary true
        renderscriptTargetApi 25
        renderscriptSupportModeEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    ***
}

Solution

  • (emphasis mine)

    In Android Studio 2.3 and higher, Instant Run significantly reduces the time it takes to update your app with code and resource changes. After deploying your app to a target device running Android 5.0 (API level 21) or higher, you can click Apply Changes to push certain code and resource changes to your running app without building a new APK—and, in some cases, without even restarting the current activity

    Android | Instant Run

    Note You can still set the targetSdkVersion and compileSdk version to the latest API levels without affecting the majority of your code. (minus any deprecated methods)