Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Instant Run restart application always

In Android Studio, the "Instant Run" function "Apply changes" enter image description here restart application always, even if no change in code (Android Studio 2.3.0 - MacOS 10.12.3). This happen when application is in Debug and paused on a break point, if then I try to apply change the app restart enter image description here

This is my build.gradle:

apply plugin: 'com.android.application'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}
buildscript {
    repositories {
        mavenCentral()
    }

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


android {
    compileSdkVersion 23
    buildToolsVersion '25.0.2'
    dexOptions {
        javaMaxHeapSize "4g"
    }
    defaultConfig {
        minSdkVersion 17
        targetSdkVersion 23
        multiDexEnabled true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }



    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src/main/java']
            resources.srcDirs = ['src/main/java']
            aidl.srcDirs = ['src/main/java']
            renderscript.srcDirs = ['src/main/java']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        //instrumentTest.setRoot('tests')
    }
}
like image 509
christian mini Avatar asked Nov 30 '25 03:11

christian mini


1 Answers

Instant Run is always disabled in the debugger:

On Android Studio 2.3, if you deploy your app by clicking Debug , pushing subsequent code changes by clicking Apply Changes always results in a cold swap. To learn more, go to issue #234401.

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

Other than that, your configuration seems to check all the boxes.

like image 188
Pierre-Luc Paour Avatar answered Dec 02 '25 17:12

Pierre-Luc Paour



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!